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

Input-Text React-18 can't edit text, cursor jumps to end #2373

Open
MarekLacoAXA opened this issue Nov 11, 2022 · 3 comments
Open

Input-Text React-18 can't edit text, cursor jumps to end #2373

MarekLacoAXA opened this issue Nov 11, 2022 · 3 comments
Assignees
Labels

Comments

@MarekLacoAXA
Copy link
Contributor

Expected Behavior

Current Behavior

  • when under React-18, cursor jumps to end of text after the keypress
  • probably because of a blur/focus cycle
  • all versions of axa-input-text are affected
  • only React-18 version is affected
  • (works with React-17)

Steps to Reproduce

  1. https://axa-ch-webhub-cloud.github.io/plib-feature/develop/?path=/story/examples-input-text-react--input-text
  2. type in text, move cursor back, type a char cursor jumps to end of text

Context (Environment)

  • Chrome/Windows

Possible Solution

@MKaHead
Copy link
Contributor

MKaHead commented Nov 12, 2022

@MarekLacoAXA I have looked at it and already have a fix. But we should keep an eye on the input text afterwards to see if the fix has side effects or if there are other problems.

@MKaHead MKaHead self-assigned this Nov 12, 2022
This was referenced Nov 12, 2022
@MKaHead MKaHead closed this as completed Nov 15, 2022
@MarekLacoAXA
Copy link
Contributor Author

MarekLacoAXA commented Nov 16, 2022

Still reproducible when "typing quicky": can by simulated by pressing several (two/three) keys at once repeatedly on the begin of text. Cursor jumps to end. (browser-dependent, doesn't occur in Safari/MacOs, does on Chrome/Win).

@MarekLacoAXA
Copy link
Contributor Author

Just to mention: PRIOR fixing this issue (with the cursor jumping to the end in React-18):
In the following browsers the text field was not unusable at all. The whole content was "randomly jumping" with each keypress:
Apple: Safari/MacOs, Chrome+Safari/iOS+iPadOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants