Skip to content

Commit

Permalink
fix(ui5-option-custom): show focus outline (#9101)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilhan007 committed Jun 1, 2024
1 parent bf2d0aa commit bf8366e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/main/src/Option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import property from "@ui5/webcomponents-base/dist/decorators/property.js";
import { isDesktop } from "@ui5/webcomponents-base/dist/Device.js";
import { IOption } from "./Select.js";
import ListItemBase from "./ListItemBase.js";
import Icon from "./Icon.js";

// Template
import OptionTemplate from "./generated/templates/OptionTemplate.lit.js";
Expand Down Expand Up @@ -37,6 +38,9 @@ import listItemAdditionalTextCss from "./generated/themes/ListItemAdditionalText
listItemIconCss,
optionBaseCss,
],
dependencies: [
Icon,
],
})
class Option extends ListItemBase implements IOption {
/**
Expand Down
8 changes: 7 additions & 1 deletion packages/main/src/OptionCustom.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
import property from "@ui5/webcomponents-base/dist/decorators/property.js";

import { isDesktop } from "@ui5/webcomponents-base/dist/Device.js";
import { IOption } from "./Select.js";
import ListItemBase from "./ListItemBase.js";

Expand Down Expand Up @@ -73,6 +73,12 @@ class OptionCustom extends ListItemBase implements IOption {
@property({ type: String })
tooltip!: string;

onEnterDOM() {
if (isDesktop()) {
this.setAttribute("desktop", "");
}
}

get effectiveDisplayText() {
return this.displayText || this.textContent || "";
}
Expand Down

0 comments on commit bf8366e

Please sign in to comment.