-
Notifications
You must be signed in to change notification settings - Fork 316
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
Move Caret to End of Input Box #419
Comments
Yeah, I can see this as being useful. I'm sure we could add an API for that. Do you have a suggestion? As a work-around in the mean time, you could possibly get away with sending a keydown event to the element with the |
Thank you for the tip on that. That being said a general API for determining where to place the caret based on length of the content inside would probably be sufficient. 👍🏻 |
Alright, I am trying to understand your needs more clearly. Can you give more details on the suggested general API, or do you mean simply a Can you point me to the related DOM/Javscript functions? |
I think this would be sufficient. It allows you to select a range of text; or simply just move the selection to the very end of the input box. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange Alternatively setting a value on an |
… ElementFormControlTextArea, see #419
Hey, I tried to implement this API now. Could you test it out, and let me know how it works for you? I didn't implement automatic movement of the cursor to the end. I'm a bit worried about how it plays out together with data bindings, and I figured it's safer to give that control fully to the user. |
Being able to move the input caret around is really useful. And at least in my case scenario, it works perfectly fine 🚀 Would it also be possible to add a getter for the current text selection? In JavaScript, which was referenced earlier, this is done by calling Similarly, are there any plans for adding these functions to Lua? 👀 |
Good to hear it's working! A As for the Lua plugin, that is mostly user-contributed. I'll happily accept any PRs ;) |
The API feels clean and works as expected, too! I was first confused by UTF-8 strings but then realized that it was just a problem with Visual Studio and the Windows console I used for debugging. I have also locally made Lua bindings for all three new methods. I guess it makes more sense to make a PR for this once the API is stable. In other words, once it is merged into the master branch. |
Great, I've merged it into master now :) |
I can't find any relevant information on this and the traditional functions that are utilized in normal javascript aren't available here.
Any options for this?
The text was updated successfully, but these errors were encountered: