Skip to content

[SDESK-7940] Fix metadata dropdown reset timing#5216

Merged
BrianMwangi21 merged 4 commits into
superdesk:release/2.10from
BrianMwangi21:SDESK-7940-chrome-fix
Jun 10, 2026
Merged

[SDESK-7940] Fix metadata dropdown reset timing#5216
BrianMwangi21 merged 4 commits into
superdesk:release/2.10from
BrianMwangi21:SDESK-7940-chrome-fix

Conversation

@BrianMwangi21

@BrianMwangi21 BrianMwangi21 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Purpose

This builds on #5199 and reworks the metadata CV dropdown reset behavior after it was noticed the subgroup navigation could bounce back to the root/preferred view in newer Chrome versions. One theory is that Chrome’s focus/blur timing exposed the issue, so the dropdown flow has been adjusted to avoid resetting subgroup state too early.

What has changed

  • Removed the sd-typeahead close hook from the metadata terms dropdown.
  • Moved state reset to the actual outer dropdown close transition.
  • Preserved subgroup navigation state while the dropdown remains open.

Steps to test

  1. Import the CV from the ticket and add it to the content profile.
  2. Configure some preferred CV items for a desk.
  3. Open authoring and search for motori.
  4. Click Motori.
  5. Verify the subgroup list opens correctly and stays in the subgroup view.
  6. Verify on other browsers.

Screenshots

screen-capture.21.mp4

Checklist

  • I reviewed my code
  • I tested all affected functionality and made sure it works

Resolves: SDESK-7940

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts the custom vocabulary (CV) metadata terms dropdown behavior to avoid subgroup navigation “bouncing” back to the root/preferred view (notably observed in newer Chrome focus/blur timing), by deferring when dropdown state is reset.

Changes:

  • Removed the sd-typeahead close hook that previously reset dropdown navigation/search state.
  • Added a reset trigger tied to the dropdown open/close lifecycle (via dropdown.isOpen watch) to reset state on close instead of on typeahead blur.
  • Aimed to preserve subgroup navigation state while the dropdown remains open.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
scripts/apps/authoring/metadata/views/metadata-terms.html Removes sd-typeahead close handler that reset state, intending to prevent premature resets during subgroup navigation.
scripts/apps/authoring/metadata/metadata.ts Updates dropdown focus directive watch to invoke resetDropdownState() when the dropdown closes (when available on scope).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/apps/authoring/metadata/views/metadata-terms.html
Comment thread scripts/apps/authoring/metadata/metadata.ts Outdated
@BrianMwangi21 BrianMwangi21 merged commit 588331b into superdesk:release/2.10 Jun 10, 2026
10 of 12 checks passed
BrianMwangi21 added a commit to BrianMwangi21/superdesk-client-core that referenced this pull request Jun 10, 2026
* [SDESK-7940] Fix metadata dropdown reset timing

* Fixed lint issue

* Fixed lint issue

* Suggested fixes

(cherry picked from commit 588331b)
BrianMwangi21 added a commit that referenced this pull request Jun 10, 2026
…lop (#5218)

* [SDESK-7940] - Selecting CV items parent not working properly first time in desks with preffered items set (#5199)

* [SDESK-7940] Fix metadata dropdown search state

* [SDESK-7940] Fix tree search test

* [SDESK-7940] Stabilize tree search spec

* [SDESK-7940] Fix tree search spec key

* suggested fixes

* simlify checking using old value

* Fixed lint issue

(cherry picked from commit af87f24)

* [SDESK-7940] Fix metadata dropdown reset timing (#5216)

* [SDESK-7940] Fix metadata dropdown reset timing

* Fixed lint issue

* Fixed lint issue

* Suggested fixes

(cherry picked from commit 588331b)
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