Skip to content

feat: keep selection when opening library#810

Open
kptdobe wants to merge 1 commit intomainfrom
fakesel
Open

feat: keep selection when opening library#810
kptdobe wants to merge 1 commit intomainfrom
fakesel

Conversation

@kptdobe
Copy link
Contributor

@kptdobe kptdobe commented Feb 26, 2026

Open a document for editing, select some content and click on the Library icon: the selection disappear.

Root cause: the focus is set on the search input of the library.

Browser cannot have a focused element and a selection at the same time. Gemini created this proposal which is to create a fake overlay. Not perfect and pretty complicated.

Test url: https://fakesel--da-live--adobe.aem.live/

@aem-code-sync
Copy link

aem-code-sync bot commented Feb 26, 2026

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

@aem-code-sync
Copy link

aem-code-sync bot commented Feb 26, 2026

Page Scores Audits Google
📱 / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Copy link
Member

@auniverseaway auniverseaway left a comment

Choose a reason for hiding this comment

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

Small nit. Otherwise looks good. Glad someone is using this feature and polishing it down to be truly useful.

disconnectedCallback() {
super.disconnectedCallback();
window.removeEventListener('keydown', this.handleKeydown);
window.dispatchEvent(new CustomEvent('da-library-close', { composed: true }));
Copy link
Member

Choose a reason for hiding this comment

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

These should be scoped to the library component, not the window.

It will be a touch annoying to get to in the DOM via web components / shadow dom and inside your Prose plugin, but it's the right thing to do.

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.

2 participants