[6.x] Fix Bard debounce race condition, Set move error, and Firefox scroll jumps#13849
Open
o1y wants to merge 3 commits intostatamic:6.xfrom
Open
[6.x] Fix Bard debounce race condition, Set move error, and Firefox scroll jumps#13849o1y wants to merge 3 commits intostatamic:6.xfrom
o1y wants to merge 3 commits intostatamic:6.xfrom
Conversation
This adds cancel() method to debounce utility to cancel pending debounced updates before immediate updates to prevent stale content from overwriting fresh changes. This could for instance happen if the user pastes content after deleting content in less than 150ms.
When moving Sets with Bard fields, the value watcher could fire while the editor is null.
Member
|
Woah, nice work! 🧙 |
jasonvarga
reviewed
Feb 10, 2026
Comment on lines
+17
to
+23
|
|
||
| debounced.cancel = function () { | ||
| clearTimeout(timeout); | ||
| timeout = null; | ||
| }; | ||
|
|
||
| return debounced; |
Member
There was a problem hiding this comment.
It's blowing my mind a bit that debounced can be a function but can also have properties? wha?
Contributor
Author
There was a problem hiding this comment.
Haha, there are also some build in ones like debounced.name, debounced.length .. functions are objects :D
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #13698
Fixes #13772
This addresses a few Bard issues:
Re-enable debouncing and fix race condition
As a workaround PR [6.x] Disable Bard debouncing #13797 previously disabled debouncing. The debouncing issues were caused by the user editing content faster than the 150ms debounce delay (e.g. when deleting content and pasting new content). This adds a
cancel()method to the debounce utility to cancel pending debounced updates before immediate updates, preventing stale content from overwriting fresh changes.Fix type error when moving Sets
Moving Sets caused the error:
Uncaught (in promise) TypeError: can't access property "getJSON", this.editor is null.Fix scroll jumps in Firefox Browsers
The stylesheet changes introduced in [6.x] Nested bard fixed toolbars - remove sticky stacking approach #13750 caused Firefox to scroll to the top of the parent Bard field when clicking into nested Bard fields.