Skip to content

fix(ui5-option): add down/active state on press#13428

Open
NakataCode wants to merge 1 commit intomainfrom
list-down-state
Open

fix(ui5-option): add down/active state on press#13428
NakataCode wants to merge 1 commit intomainfrom
list-down-state

Conversation

@NakataCode
Copy link
Copy Markdown
Contributor

@NakataCode NakataCode commented Apr 23, 2026

Introduce visual active/pressed state for ui5-option and ui5-option-custom inside ui5-select. When the user presses and holds on an option in the dropdown, the item reflects the active state using sapList_Active_Background, matching the Fiori design spec for interactive list states.

  • Add active boolean property and _onmousedown handler to Option and OptionCustom
  • Register document-level mouseup/touchend listeners in onEnterDOM to deactivate
  • Wire onMouseDown and onTouchStart via injectedProps in ListItemBaseTemplate
  • Fix border-bottom-color in active state to match background (ListItemBase.css)
  • Add JsxTemplate type for listItemContent hook in ListItemBaseTemplate
  • Add Cypress tests for active state on mousedown/mouseup for both option types

Fixes: #13307

@ui5-webcomponents-bot
Copy link
Copy Markdown
Collaborator

@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview April 23, 2026 10:05 Inactive
Copy link
Copy Markdown
Contributor

@plamenivanov91 plamenivanov91 left a comment

Choose a reason for hiding this comment

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

Can we achieve the target design CSS only?

/* Current */
:host([active][actionable]:not([data-moving])) {
background-color: var(--sapList_Active_Background);
border-bottom-color: var(--sapList_Active_Background);
}

/* Instead, use CSS :active */
:host(:active[actionable]:not([data-moving])) {
background-color: var(--sapList_Active_Background);
border-bottom-color: var(--sapList_Active_Background);
}

Without introducing JS overhead?

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.

[Select][Web Components][2.20.1]: List item down state is missing

3 participants