-
Notifications
You must be signed in to change notification settings - Fork 41
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
selectionStart / selectionEnd are always 0 #62
Comments
Faced the same issue with custom phone number input. Event handler need the actual DOM node to handle cursor position.
As a temporary solution I using ref and patch the event back: const inputRef = React.useRef<InputRef>(null);
return (
<Input onChange={(event) => {
const currentTarget = inputRef.current!.input;
event = Object.create(event, {
target: { value: currentTarget },
currentTarget: { value: currentTarget },
});
handleChange(event);
}} />
); |
@yyz945947732 Look at this issue. |
I have same issue... 😢 |
@yyz945947732 ping~ |
Fixed in #65 |
After this change (most likely) #54, which came into effect with antd 5.12.3,
onchange
event from the input always has selectionStart / selectionEnd properties set to 0 instead of the actual numbersWe have custom input processing (related to the currency formatting), which worked perfectly for the past 6 years until this change.
Would it be possible to have a look into this issue?
The text was updated successfully, but these errors were encountered: