Skip to content

[Editor] Ensure that highlightSelection waits until we've fully updated the editing-mode (issue 19369) #19371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Jan 23, 2025

With the changes in PR #18843 the AnnotationEditorUIManager.prototype.updateMode method is now asynchronous, which we need to take into account when dispatching the "annotationeditormodechanged" event.

Edit: I don't know if this is necessarily the "correct" way to address this, but it appears to work.

@avdoseferovic
Copy link
Contributor

I experienced the similar issue withing the updateMode when using the PdfViewer component. for some reason the next tool gets enabled before the old one is committed / cleaned up. I'm setting the mode with the setter: set annotationEditorMode

can you please also fix it in

pdf_viewer.js L2343

    const updater = () => {
      this.#cleanupSwitchAnnotationEditorMode();
      this.#annotationEditorMode = mode;
      this.#annotationEditorUIManager.updateMode(mode, editId, isFromKeyboard);
      eventBus.dispatch("annotationeditormodechanged", {
        source: this,
        mode,
      });
    };
    

@mozilla mozilla deleted a comment from moz-tools-bot Jan 23, 2025
@mozilla mozilla deleted a comment from moz-tools-bot Jan 23, 2025
@mozilla mozilla deleted a comment from moz-tools-bot Jan 23, 2025
@mozilla mozilla deleted a comment from moz-tools-bot Jan 23, 2025
@avdoseferovic
Copy link
Contributor

@Snuffleupagus thank you!

…ated the editing-mode (issue 19369)

With the changes in PR 18843 the `AnnotationEditorUIManager.prototype.updateMode` method is now asynchronous, which we need to take into account when dispatching the "annotationeditormodechanged" event.
@mozilla mozilla deleted a comment from moz-tools-bot Jan 23, 2025
@mozilla mozilla deleted a comment from moz-tools-bot Jan 23, 2025
@mozilla mozilla deleted a comment from moz-tools-bot Jan 23, 2025
@mozilla mozilla deleted a comment from moz-tools-bot Jan 23, 2025
@Snuffleupagus
Copy link
Collaborator Author

/botio integrationtest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/3bdc507ef9f123d/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/e1b4456801a8926/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/3bdc507ef9f123d/output.txt

Total script time: 10.49 mins

  • Integration Tests: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/e1b4456801a8926/output.txt

Total script time: 26.31 mins

  • Integration Tests: FAILED

Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you.

@Snuffleupagus Snuffleupagus merged commit 2132552 into mozilla:master Jan 23, 2025
7 checks passed
@Snuffleupagus Snuffleupagus deleted the issue-19369 branch January 23, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: highlightSelection only works on first invocation
4 participants