@@ -482,7 +482,7 @@ class InputGuard {
482482 this . applySeparateValue ( ) ;
483483 this . bindEvents ( ) ;
484484 // 初期値を評価
485- this . evaluateInput ( ) ;
485+ this . evaluateCommit ( ) ;
486486 }
487487
488488 /**
@@ -776,10 +776,10 @@ class InputGuard {
776776 if ( inputType === "deleteContentBackward" ) {
777777 // Backspace: キャレットの左側1文字を削除
778778 replaceStart = Math . max ( 0 , replaceStart - 1 ) ;
779- replaceEnd = snapSel . start ?? replaceEnd ;
779+ replaceEnd = snapSel ? .start ?? replaceEnd ;
780780 } else if ( inputType === "deleteContentForward" ) {
781781 // Delete: キャレットの右側1文字を削除
782- replaceStart = snapSel . start ?? replaceStart ;
782+ replaceStart = snapSel ? .start ?? replaceStart ;
783783 replaceEnd = Math . min ( beforeText . length , replaceEnd + 1 ) ;
784784 }
785785 // 追加で拾うならここ:
@@ -1145,6 +1145,19 @@ class InputGuard {
11451145 const ctx = this . createCtx ( ) ;
11461146 ctx . afterText = current ;
11471147
1148+ // beforeinput が取得できない経路(初回評価)では
1149+ // 差分再構成を行うと lastAcceptedValue 基準で値を落とす可能性があるため、
1150+ // 現在の全文を正規化して扱うフォールバックへ切り替える。
1151+ if ( ! this . beforeInputSnapshot ) {
1152+ let newText = current ;
1153+ ctx . beforeText = "" ;
1154+ newText = this . runNormalizeChar ( newText , ctx ) ;
1155+ newText = this . runNormalizeStructure ( newText , ctx ) ;
1156+ this . setDisplayValuePreserveCaret ( display , newText , ctx ) ;
1157+ ctx . afterText = newText ;
1158+ return ctx ;
1159+ }
1160+
11481161 // 元のテキスト
11491162 const beforeText = ctx . beforeText ;
11501163
0 commit comments