-
Notifications
You must be signed in to change notification settings - Fork 17
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: Fehler, wenn man den type auf "email" ändert. #2445
Comments
Hi @christoph-schlumpf , could you please add the "Steps to Reproduce"? |
I have added „Steps to reproduce“. I suspect this issue always happens in a React app. If you have an example where this issue does not happen inside React we would be glad to have a look at it. Best regards, |
@christoph-schlumpf This is a consequence of using React with input components in controlled mode. Since that's one of the bad ideas of React, it's exceedingly hard if not impossible to override browser-native stateful HTML elements in all aspects. The error message says that for whatever reason a type-email input cannot set the selectionrange, i.e. where the cursor is. We added setting the selectionrange for another 'bug', also controlled mode. Of course we could fix this new issue by not setting selectionrange when input of type email is used, but the better approach - which we would ask to try - is to just use uncontrolled components, while still achieving your desired UX. Please report back here after you tried that systematic workaround. |
Hi @markus-walther , We will have a look at your proposal to use the component in Uncontrolled mode. We will inform you about our results. Best regards PS: Please keep this issue open untill we can confirm that the proposed solution is OK in our UX. |
Hi @markus-walther, As many React applications use controlled components I would suggest that you nevertheless fix the issue. Additionally it would be very helpful to mention in the documentation on https://axa-ch-webhub-cloud.github.io/plib-feature/develop/?path=/story/components-input-text--input-text -> "Usage" that the component should only be used as an uncontrolled component in React because there are issues when it is used as a controlled component. Best regards, |
Der Input Text wirf einen Fehler, wenn man den type auf "email" ändert. Tritt bei der Verwendung als React Component auf.
Expected Behavior
Keine Fehlermeldung in der Console, wenn an InputText mit type 'email' verwendet.
Current Behavior
Error in der Browser Console:
Uncaught DOMException: Failed to execute 'setSelectionRange' on 'HTMLInputElement': The input element's type ('email') does not support selection.
Steps to Reproduce
We alredy have shown the issue to a Webhub Developer and he confirmed the issue. Feel free to contaxt me so I can show you the issue in our app.
Context (Environment)
React Application. Wir benutzen axa-input-text: '6.3.0', axa-popup: '5.0.9'
Possible Solution
The text was updated successfully, but these errors were encountered: