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

Dynamic blur values #712

Open
yeeland opened this issue Dec 15, 2017 · 5 comments
Open

Dynamic blur values #712

yeeland opened this issue Dec 15, 2017 · 5 comments

Comments

@yeeland
Copy link

yeeland commented Dec 15, 2017

We recently ran into a feature request where users would like editable inputs to cancel on blur if nothing has been entered but ignore if the input has text. We attempted to set the blur attribute to something dynamic but it looks like the form only checks for the blur value in the compile step here.

Can anything be done to allow for a dynamic blur value? Or can we add a cancelIfEmpty option for blur?

@ckosloski
Copy link
Contributor

Can you explain more what it is you are trying to achieve?
Are you trying to prevent save calls to the back end by cancelling if nothing has submitted?

@yeeland
Copy link
Author

yeeland commented Dec 15, 2017

@ckosloski originally, we had textareas that would cancel whenever you blurred but users would type long content in those textareas, click outside of the form, and lose all that they had typed in the input. However, they do like the convenience of being able to click outside of the form if they haven't typed anything instead of having to find and click the cancel button.

@ckosloski
Copy link
Contributor

Why not just set the blur to submit?

@yeeland
Copy link
Author

yeeland commented Dec 15, 2017

@ckosloski To answer your second question in the original comment, we are looking to avoid a backend call unless the user has hit the save button.

@ckosloski
Copy link
Contributor

Why can't you check the existence of data before submitting to backend?
Or maybe add a onbeforesave call that returns false if no data was entered (and doesn't call the backend)

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