Skip to content

fix: [DHIS2-21708] Org unit selector is expanded when form open if no org unit in top bar#4629

Draft
henrikmv wants to merge 10 commits into
masterfrom
hv/fix/DHIS2-21708_expanded-org-unit-selector
Draft

fix: [DHIS2-21708] Org unit selector is expanded when form open if no org unit in top bar#4629
henrikmv wants to merge 10 commits into
masterfrom
hv/fix/DHIS2-21708_expanded-org-unit-selector

Conversation

@henrikmv

@henrikmv henrikmv commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

DHIS2-21708

Refactors the SingleOrgUnitSelectField from an always-visible org unit tree into a collapsed dropdown with a popover. When no value is selected, the user sees a combobox trigger with a chevron icon. Clicking it opens a Popover containing the org unit tree, with a debounced search input embedded in the trigger.

Key changes:

  • SingleOrgUnitSelectField: replaces inline tree with a trigger + Popover pattern, adds keyboard navigation, debounced search, and open/close state management.
  • OrgUnitField: adds hideSearchField and searchText props so the parent can control search externally.

devin-ai-integration[bot]

This comment was marked as resolved.

@henrikmv henrikmv marked this pull request as draft June 26, 2026 13:24
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@sonarqubecloud

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot 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.

Devin Review found 1 new potential issue.

Open in Devin Review

Comment on lines +228 to +249
<div
ref={this.anchorRef}
className={triggerClassName}
>
<input
ref={this.searchInputRef}
className={classes.searchInput}
value={open ? inputValue : ''}
onChange={this.handleInputChange}
onClick={this.openMenu}
onKeyDown={this.handleKeyDown}
readOnly={!open}
disabled={disabled}
placeholder={open ? i18n.t('Search for an organisation unit') : undefined}
aria-haspopup="tree"
aria-controls={open ? this.popoverId : undefined}
data-test="org-unit-selector-trigger"
/>
<span className={classes.chevron}>
<IconChevronDown16 />
</span>
</div>

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.

🚩 Chevron icon area does not trigger popover open

The onClick={this.openMenu} handler is only on the <input> element (line 237), not on the outer trigger <div> or the chevron <span> (lines 246-248). Since the input has flexGrow: 1 and the chevron has marginLeft: 'auto', clicking the small chevron icon area (~16px) won't open the popover. Most dropdown-like components make the entire trigger area clickable. This is a minor UX gap but not a functional bug.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

1 participant