This repository was archived by the owner on Sep 8, 2020. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork 368
This repository was archived by the owner on Sep 8, 2020. It is now read-only.
debounce bug #256
Copy link
Copy link
Closed
Description
I have a page where the user edits a model & hits "save".
<textarea ui-tinymce="tinymceOptions" ng-model="block.html"></textarea> {{block}} As I type, I do not see {{block}} update until I stop typing for about 1 second. Sometimes the user will hit save before the "debounce" updates the scope, and they lose a bunch of work. Why would it use debounce instead of throttle?
Found this in the source:
/Debounce update and save action var debouncedUpdate = (function(debouncedUpdateDelay) { var debouncedUpdateTimer; return function(ed) { $timeout.cancel(debouncedUpdateTimer); debouncedUpdateTimer = $timeout(function() { return (function(ed) { if (ed.isDirty()) { ed.save(); updateView(ed); } })(ed); }, debouncedUpdateDelay); }; })(400);At the very least let the user change the value from 400 to a custom value, to prevent users from saving the old scope before it updates. I feel it really should not be using throttling, not debounce. The users can do that with ng-model-options. Or if throttling is necessary, that would be "Acceptable" but debouce causes major issues.
Metadata
Metadata
Assignees
Labels
No labels