-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] spreadsheet: avoid parasitic renders
Clicking on a button on the topbar would trigger 3 renders: - one on model update (expected) - one because we received a collaborative event for our own revision (useless) - one because the onClick of the topbar calls `DOMFocusableElementStore.focus`, which triggers a render because a store method was called (useless) closes #5346 Task: 4373054 Signed-off-by: Rémi Rahir (rar) <[email protected]>
- Loading branch information
1 parent
d8f81f1
commit 30e1e37
Showing
7 changed files
with
38 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
export class DOMFocusableElementStore { | ||
mutators = ["setFocusableElement", "focus"] as const; | ||
private focusableElement: HTMLElement | undefined = undefined; | ||
mutators = ["setFocusableElement"] as const; | ||
focusableElement: HTMLElement | undefined = undefined; | ||
|
||
setFocusableElement(element: HTMLElement) { | ||
this.focusableElement = element; | ||
} | ||
|
||
focus() { | ||
this.focusableElement?.focus(); | ||
} | ||
} |
This file contains 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
This file contains 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