-
Notifications
You must be signed in to change notification settings - Fork 79
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
Bidirectional inputs move cursor #215
Comments
In this specific case, it seems to be tied to your use of You might consider using that only if the decimal place exceeds the desired amount. You could also debounce your handler function so that it only runs after the user is done typing. Here's a demo: https://codepen.io/cferdinandi/pen/qEWjeme?editors=0010 |
I don't think it's related to |
I'll look into debouncing, but I still would ideally like to do live update. The desired behavior on my end is pretty much "don't re-render the element being edited" |
Sounds like this bit on preserving cursor position may be helpful? https://stackoverflow.com/questions/14508707/updating-an-inputs-value-without-losing-cursor-position This is a byproduct of setting the This is an example of where I think Reef is actually not the right tool, and you might be better served by a Web Component and old-school DOM manipulation. |
I will look into the JS--thank you--but I think you may be right. I'll keep my tool as-is with its ugly JS and try to keep Reef in mind for another future project! |
Although there isn't really a place for |
You can do things after render using the |
It occurs to me that one other way to avoid this issue might be an under-the-hood change, where I check the I thought I was doing that already, but I'll dig into the source code and if not, fix that. |
Hi - thanks for Reef. It looks really interesting and small. I tried converting one of my mini apps (a shoddy currency converter) to use Reef to learn more about it. This page uses two
input
fields. Writing into one changes the other. When porting to Reef, I noticed that the page re-renders cause the cursor to get moved around mid-edit. I wonder if there is a canonical way around this. For example, try select-all in one of theinput
s and type123
to replace it.Test case: https://codepen.io/gjnbnywp-the-vuer/pen/yyBXwea
The text was updated successfully, but these errors were encountered: