angular-xeditable
angular-xeditable copied to clipboard
Dynamic blur values
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
?
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?
@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.
Why not just set the blur to submit?
@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.
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)