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
Draft
fix: [DHIS2-21708] Org unit selector is expanded when form open if no org unit in top bar#4629henrikmv wants to merge 10 commits into
henrikmv wants to merge 10 commits into
Conversation
… DataEntry components
… accessibility improvements
|
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> |
Contributor
There was a problem hiding this comment.
🚩 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



DHIS2-21708
Refactors the
SingleOrgUnitSelectFieldfrom 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 aPopovercontaining the org unit tree, with a debounced search input embedded in the trigger.Key changes:
SingleOrgUnitSelectField: replaces inline tree with a trigger +Popoverpattern, adds keyboard navigation, debounced search, and open/close state management.OrgUnitField: addshideSearchFieldandsearchTextprops so the parent can control search externally.