Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor position is shifted incorrectly in Localized number field component #10289

Closed
1 task done
dsuren1 opened this issue May 8, 2024 · 0 comments · Fixed by #10312 or #10346
Closed
1 task done

Cursor position is shifted incorrectly in Localized number field component #10289

dsuren1 opened this issue May 8, 2024 · 0 comments · Fixed by #10312 or #10346

Comments

@dsuren1
Copy link
Contributor

dsuren1 commented May 8, 2024

Description

Current localized number field component exhibits certain behavior which makes it editing field values a bit complex

  • When editing values in-between number, on change value, the cursor position always shifts to last
  • Upon performing any key combination (ctrl + a) the same behavior is exhibited and text selection is not retained

Note

Works fine which mouse selection though

How to reproduce

  • Edit a numeric field that is localized and enter values such that thousandSeparator is introduced
  • Observe the cursor position is shifted to the last instead of retaining it's correct position

Expected Result
Cursor position is retained correctly when editing value in a localized number field

Current Result
Cursor position is shifted incorrectly when editing values in-between number i.e on change value or any keyboard action like (ctrl+a) and text selection is not retained

  • Not browser related
Browser info (use this site: https://www.whatsmybrowser.org/ for non expert users)
Browser Affected Version
Internet Explorer
Edge
Chrome
Firefox
Safari

Other useful information

@tdipisa tdipisa assigned mahmoudadel54 and unassigned tdipisa May 8, 2024
@tdipisa tdipisa added this to the 2024.01.01 milestone May 8, 2024
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue May 13, 2024
…lized number field component

Description:
- fix the jumping cursor to unexpected positions for localized numeric input
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue May 13, 2024
…lized number field component

Description:
- replace logic in updateDidMount to onKeyUp
- remove unused comments
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue May 13, 2024
…lized number field component

Description:
- remove unused method in IntlNumberFormControl
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue May 16, 2024
…lized number field component [resolve review comments]

Description:
- fix issue of on focus effect in NumericInput
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue May 16, 2024
…lized number field component [resolve review comments]

Description:
- fix FE issue in onKeyDown in IntlNumberFormControl
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue May 16, 2024
…lized number field component [resolve review comments]

Description:
- revert unnecessary change
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue May 16, 2024
…lized number field component [resolve review comments]

Description:
- move the fixing logic of cursor position to componentDidUpdate instead of onKeyUp
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue May 17, 2024
…lized number field component [resolve review comments]

Description:
- add onKeyUp as a prop into IntlNumberFormControl for any expected future consuming from a parent comp
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue May 17, 2024
…lized number field component [resolve review comments]

Description:
- add unit test
- resolve review comments
dsuren1 pushed a commit that referenced this issue May 20, 2024
…eld component (#10312)

* #10289: Cursor position is shifted incorrectly in Localized number field component
Description:
- fix the jumping cursor to unexpected positions for localized numeric input

* #10289: Cursor position is shifted incorrectly in Localized number field component
Description:
- replace logic in updateDidMount to onKeyUp
- remove unused comments

* #10289: Cursor position is shifted incorrectly in Localized number field component
Description:
- remove unused method in IntlNumberFormControl

* #10136: Search for Map CRS coordinates
Description:
- resolve FE failure in unit test

* #10289: Cursor position is shifted incorrectly in Localized number field component [resolve review comments]
Description:
- fix issue of on focus effect in NumericInput

* #10289: Cursor position is shifted incorrectly in Localized number field component [resolve review comments]
Description:
- fix FE issue in onKeyDown in IntlNumberFormControl

* #10289: Cursor position is shifted incorrectly in Localized number field component [resolve review comments]
Description:
- revert unnecessary change

* #10289: Cursor position is shifted incorrectly in Localized number field component [resolve review comments]
Description:
- move the fixing logic of cursor position to componentDidUpdate instead of onKeyUp

* #10289: Cursor position is shifted incorrectly in Localized number field component [resolve review comments]
Description:
- add onKeyUp as a prop into IntlNumberFormControl for any expected future consuming from a parent comp

* #10289: Cursor position is shifted incorrectly in Localized number field component [resolve review comments]
Description:
- add unit test
- resolve review comments
@ElenaGallo ElenaGallo self-assigned this May 20, 2024
@ElenaGallo ElenaGallo added the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label May 20, 2024
mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this issue May 21, 2024
…lized number field component (geosolutions-it#10312)

* geosolutions-it#10289: Cursor position is shifted incorrectly in Localized number field component
Description:
- fix the jumping cursor to unexpected positions for localized numeric input

* geosolutions-it#10289: Cursor position is shifted incorrectly in Localized number field component
Description:
- replace logic in updateDidMount to onKeyUp
- remove unused comments

* geosolutions-it#10289: Cursor position is shifted incorrectly in Localized number field component
Description:
- remove unused method in IntlNumberFormControl

* geosolutions-it#10136: Search for Map CRS coordinates
Description:
- resolve FE failure in unit test

* geosolutions-it#10289: Cursor position is shifted incorrectly in Localized number field component [resolve review comments]
Description:
- fix issue of on focus effect in NumericInput

* geosolutions-it#10289: Cursor position is shifted incorrectly in Localized number field component [resolve review comments]
Description:
- fix FE issue in onKeyDown in IntlNumberFormControl

* geosolutions-it#10289: Cursor position is shifted incorrectly in Localized number field component [resolve review comments]
Description:
- revert unnecessary change

* geosolutions-it#10289: Cursor position is shifted incorrectly in Localized number field component [resolve review comments]
Description:
- move the fixing logic of cursor position to componentDidUpdate instead of onKeyUp

* geosolutions-it#10289: Cursor position is shifted incorrectly in Localized number field component [resolve review comments]
Description:
- add onKeyUp as a prop into IntlNumberFormControl for any expected future consuming from a parent comp

* geosolutions-it#10289: Cursor position is shifted incorrectly in Localized number field component [resolve review comments]
Description:
- add unit test
- resolve review comments
dsuren1 pushed a commit that referenced this issue May 21, 2024
…eld component (#10312) (#10346)

* #10289: Cursor position is shifted incorrectly in Localized number field component
Description:
- fix the jumping cursor to unexpected positions for localized numeric input

* #10289: Cursor position is shifted incorrectly in Localized number field component
Description:
- replace logic in updateDidMount to onKeyUp
- remove unused comments

* #10289: Cursor position is shifted incorrectly in Localized number field component
Description:
- remove unused method in IntlNumberFormControl

* #10136: Search for Map CRS coordinates
Description:
- resolve FE failure in unit test

* #10289: Cursor position is shifted incorrectly in Localized number field component [resolve review comments]
Description:
- fix issue of on focus effect in NumericInput

* #10289: Cursor position is shifted incorrectly in Localized number field component [resolve review comments]
Description:
- fix FE issue in onKeyDown in IntlNumberFormControl

* #10289: Cursor position is shifted incorrectly in Localized number field component [resolve review comments]
Description:
- revert unnecessary change

* #10289: Cursor position is shifted incorrectly in Localized number field component [resolve review comments]
Description:
- move the fixing logic of cursor position to componentDidUpdate instead of onKeyUp

* #10289: Cursor position is shifted incorrectly in Localized number field component [resolve review comments]
Description:
- add onKeyUp as a prop into IntlNumberFormControl for any expected future consuming from a parent comp

* #10289: Cursor position is shifted incorrectly in Localized number field component [resolve review comments]
Description:
- add unit test
- resolve review comments
@ElenaGallo ElenaGallo added Accepted and removed BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch labels May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment