Fix clm content reminder#403
Draft
Tishasoumya-02 wants to merge 4 commits into
Draft
Conversation
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.
Reason why this happened : The Document Review menu is a react-aria Popover + Dialog, which portals its content to document.body by rac-design. Volto's Toolbar component decides when to close its "more" menu by detecting interaction outside the menu, and it does this through two independent mechanisms:
handleClickOutside — a mousedown listener on document. It only exempts clicks inside the collapsed toolbar bar, so a click on the body-portaled popover counts as "outside" and closes the menu.
The menu container's onBlur — closes the menu when focus moves to an element not contained in the toolbar window. react-aria's Dialog moves focus into the (body-portaled) popover on open, which trips this immediately.
Because the popover lives outside the toolbar's DOM subtree, both closers fire, so the menu closed before the user could interact.
The fix I went with here - Since auto-moves focus into the popover on open. no (no focus pull) + isNonModal (no modal focus trap) = focus never leaves toolbar = onBlur never closes menu. But this breaks the assistive Tech. Not sure if we want that.
More efficient but would need customisation of the toolbar and stopping the onBlur from propagation
if (e.relatedTarget?.closest('.review-popover')) return;and it did work ,keeping everything else as it was before.There were some changes recently in the Toolbar.jsx which caused this issue: plone/volto#8019
@iFlameing / @danalvrz