-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ui5-option): correct tooltip property forwarding (#9502)
As a side effect of #9015, an issue was introduced, making the tooltip property of the Option unused. This change allows customization of the attributes of the ListItemBase tempalte which the Option and OptionCustom classes implement to forward the tooltip property to the title attribute of the list item.
- Loading branch information
1 parent
a4bc8e0
commit dde34fc
Showing
4 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,8 @@ | |
{{/if}} | ||
</div> | ||
</div> | ||
{{/inline}} | ||
{{/inline}} | ||
|
||
{{#*inline "listItemAttributes"}} | ||
title="{{tooltip}}" | ||
{{/inline}} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { html } from 'lit'; | ||
|
||
describe("Select - Accessibility", () => { | ||
it("tests options tooltip is set displayed", () => { | ||
const EXPECTED_TOOLTIP = "Tooltip"; | ||
cy.mount(html` | ||
<ui5-select> | ||
<ui5-option value="1" tooltip="${EXPECTED_TOOLTIP}">Option 1</ui5-option> | ||
<ui5-option-custom value="2" tooltip="${EXPECTED_TOOLTIP}">Option 2</ui5-option-custom> | ||
</ui5-select> | ||
`); | ||
|
||
cy | ||
.get("[ui5-option][tooltip]") | ||
.shadow() | ||
.find("li.ui5-li-root") | ||
.should("have.attr", "title", EXPECTED_TOOLTIP) | ||
.get("[ui5-option-custom][tooltip]") | ||
.shadow() | ||
.find("li.ui5-li-root") | ||
.should("have.attr", "title", EXPECTED_TOOLTIP); | ||
}); | ||
}); |