-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ui5-li-group): forward focused attribute to header item (#8978)
fix(ui5-li-group): forward focused attribute to header item Introduce focused attribute to implement fake focus feature in suggestion items.
- Loading branch information
1 parent
410ba3f
commit fabe257
Showing
3 changed files
with
50 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<ul class="ui5-group-li-root" role="group"> | ||
{{#if hasHeader}} | ||
<ui5-li-group-header part="header"> | ||
{{#if hasFormattedHeader}} | ||
<slot name="header"></slot> | ||
{{else}} | ||
{{headerText}} | ||
{{/if}} | ||
</ui5-li-group-header> | ||
{{/if}} | ||
<slot></slot> | ||
</ul> | ||
<ul class="ui5-group-li-root" role="group"> | ||
{{#if hasHeader}} | ||
<ui5-li-group-header ?focused="{{focused}}" part="header"> | ||
{{#if hasFormattedHeader}} | ||
<slot name="header"></slot> | ||
{{else}} | ||
{{headerText}} | ||
{{/if}} | ||
</ui5-li-group-header> | ||
{{/if}} | ||
<slot></slot> | ||
</ul> |
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,31 @@ | ||
import { assert } from "chai"; | ||
|
||
describe("ListItemGroup Tests", () => { | ||
before(async () => { | ||
await browser.url(`test/pages/List_test_page.html`); | ||
}); | ||
|
||
it("ListGroup is rendered", async () => { | ||
const listItemGroup = await browser.$("#list1 [ui5-li-group]"); | ||
const listItemGroupHeader = await listItemGroup.shadow$("ui5-li-group-header"); | ||
|
||
assert.ok(listItemGroup.isExisting(), true, "ListGroup is rendered"); | ||
assert.ok(listItemGroupHeader.isExisting(), true, "ListGroup header is rendered"); | ||
}); | ||
|
||
it("ListGroup renders header-text property correctly", async () => { | ||
const listItemGroup = await browser.$("#list1 [ui5-li-group]"); | ||
const listItemGroupHeader = await listItemGroup.shadow$("ui5-li-group-header"); | ||
|
||
assert.strictEqual(await listItemGroupHeader.getText(), "New Items", "List's group header is correctly displayed"); | ||
}); | ||
|
||
it("ListGroup propagates focused property to header item", async () => { | ||
const listItemGroup = await browser.$("#list1 [ui5-li-group]"); | ||
const listItemGroupHeader = await listItemGroup.shadow$("ui5-li-group-header"); | ||
|
||
await listItemGroup.setProperty("focused", true); | ||
assert.strictEqual(await listItemGroupHeader.getProperty("focused"), true, "List's group header is focused"); | ||
await listItemGroup.setProperty("focused", false); | ||
}); | ||
}); |