Skip to content

Conversation

@mejo-
Copy link
Member

@mejo- mejo- commented Sep 8, 2022

Backport of #2872

Ensure the menububble always shows the correct entries.

The menububble shows different buttons if the selected text is a link. However its content often became out of sync with the editor:

  • when new text was selected the bubble was still cached
  • when the selection stayed active but was expanded / shrinked the menu bubble also stayed the same
  • when someone else editing the same page changed the current selection into a link

Recompute the menububbles active data on every editor change.

The code used for this is mostly taken from the menu bars mechanism for the same purpose.
See updateState in src/components/Menu/BaseActionEntry.js.

Signed-off-by: Max [email protected]

  • Resolves: #
  • Target version: master

Summary

Ensure the menububble always shows the correct entries.

The menububble shows different buttons if the selected text is a link.
However its content often became out of sync with the editor:
* when new text was selected the bubble was still cached
* when the selection stayed active but was expanded / shrinked
  the menu bubble also stayed the same
* when someone else editing the same page changed the current selection into a link

Recompute the menububbles `active` data on every editor change.

The code used for this is mostly taken from the menu bars mechanism
for the same purpose.
See updateState in src/components/Menu/BaseActionEntry.js.

Signed-off-by: Max <[email protected]>
@mejo- mejo- added this to the Nextcloud 24.0.6 milestone Sep 8, 2022
@mejo-
Copy link
Member Author

mejo- commented Sep 8, 2022

Closing, as #2874 exists.

@mejo- mejo- closed this Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants