File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
src/Controls/src/Core/InputView Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -184,8 +184,13 @@ public int CursorPosition
184184 // need to always push the xplat -> native value flow in scenarios such as "select all text on focus". If we
185185 // don't do this the native control will handle the input event and move the cursor after we set the selection
186186 // length/cursor position, which is not the desired behavior.
187+ bool forceHandlerUpdate = ( int ) GetValue ( CursorPositionProperty ) == value ;
187188 SetValue ( CursorPositionProperty , value ) ;
188- Handler ? . UpdateValue ( nameof ( CursorPosition ) ) ;
189+
190+ if ( forceHandlerUpdate )
191+ {
192+ Handler ? . UpdateValue ( nameof ( CursorPosition ) ) ;
193+ }
189194 }
190195 }
191196
@@ -198,8 +203,13 @@ public int SelectionLength
198203 get { return ( int ) GetValue ( SelectionLengthProperty ) ; }
199204 set
200205 {
206+ bool forceHandlerUpdate = ( int ) GetValue ( SelectionLengthProperty ) == value ;
201207 SetValue ( SelectionLengthProperty , value ) ;
202- Handler ? . UpdateValue ( nameof ( SelectionLength ) ) ;
208+
209+ if ( forceHandlerUpdate )
210+ {
211+ Handler ? . UpdateValue ( nameof ( SelectionLength ) ) ;
212+ }
203213 }
204214 }
205215
You can’t perform that action at this time.
0 commit comments