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

Prevent updates for all user input #2377

Closed
SethTurin opened this issue Jun 6, 2017 · 3 comments
Closed

Prevent updates for all user input #2377

SethTurin opened this issue Jun 6, 2017 · 3 comments

Comments

@SethTurin
Copy link

@SethTurin SethTurin commented Jun 6, 2017

Is there a way to prevent updates for all user input? I'm using riot in a complex editable div, and the updates reset user text with every key and every mouse button. Currently, all my components end up needing something like this:

    keydown="{preventUpdates}"
    keyup="{preventUpdates}"
    keypress="{preventUpdates}"
    mousedown="{preventUpdates}"
    click="{preventUpdates}"

which get's really ugly. I do all my updates at specific points in the code anyway, so it would be a lot easier for me to just turn off all updates triggered by user input. Is there a way to do this?

@wintercounter
Copy link

@wintercounter wintercounter commented Jun 7, 2017

You can use a mixin which does this for you. Also you can have a global mixin so it get's applied to all tags, but I wouldn't recommend that.

@GianlucaGuarini
Copy link
Member

@GianlucaGuarini GianlucaGuarini commented Jun 7, 2017

I think this could be a feature request rather easy to implement. I will work on it

GianlucaGuarini added a commit that referenced this issue Jun 7, 2017
@SethTurin
Copy link
Author

@SethTurin SethTurin commented Jun 7, 2017

wow, that's awesome, thanks. so in the next release, do I just pass in autoUpdate: false to the compiler settings?

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.