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 setSelection() method workflow, when text overflows input container #173

Closed
Lipata opened this issue Feb 22, 2018 · 1 comment
Closed

Comments

@Lipata
Copy link

Lipata commented Feb 22, 2018

How the setSelectionRange() method is supposed to work, when the input caret is moved to a position in the text, where it is not visible? Here is the sample.

What I expect is that when I focus the input, and then call setSelectionRange() method, then the text is scrolled to the position, where the caret has already been moved. I've already logged two issues to Chrome and Microsoft (I was not with the intend that they were issues, I was not sure how this should work). The guys from Microsoft told me that this has been already fixed. The guys from Chromium project kindly shared their implementation and said that if I want to scroll to caret position I need to focus after the setSelectionRange() method takes place.

@johanneswilm
Copy link
Contributor

@Lipata I believe your question should be directed to the WHATWG Form spec. They are discussing input elements there. The editing taskforce is mainly dealing with richtext input. https://html.spec.whatwg.org/multipage/input.html#the-input-element

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

No branches or pull requests

2 participants