Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const fillInput = (data, value) => {

item.innerHTML = `
<div class='item-content'>
<ui5-icon name="globe"></ui5-icon>
<ui5-icon name="globe" aria-hidden="true"></ui5-icon>
<div class='item-titles'>
<span>${generateHighlightedMarkup(country, value)}</span>
<small>EU</small>
Expand All @@ -51,5 +51,5 @@ const fillInput = (data, value) => {
input.addEventListener("ui5-selection-change", e => {
const text = e.detail.item?.text;

announce(text, "Polite");
announce(text + " EU", "Polite");
})
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { type UI5CustomEvent } from "@ui5/webcomponents-base";
import InputClass from "@ui5/webcomponents/dist/Input.js";
import SuggestionItemCustomClass from "@ui5/webcomponents/dist/SuggestionItemCustom.js";
import IconClass from "@ui5/webcomponents/dist/Icon.js";
import announce from "@ui5/webcomponents-base/dist/util/InvisibleMessage.js";
import "@ui5/webcomponents/dist/features/InputSuggestions.js";
import "@ui5/webcomponents-icons/dist/globe.js";

Expand All @@ -27,6 +28,11 @@ function App() {
const [suggestions, setSuggestions] = useState<string[]>([]);
const [inputValue, setInputValue] = useState("");

const handleSelectionChange = (e: UI5CustomEvent<InputClass, "selection-change">) => {
const text = (e.detail as any).item?.text;
announce(text + " EU", "Polite");
};

const handleInput = (e: UI5CustomEvent<InputClass, "input">) => {
const value = e.currentTarget.value;
setInputValue(value);
Expand Down Expand Up @@ -63,11 +69,12 @@ function App() {
placeholder="Type something ..."
showSuggestions={true}
onInput={handleInput}
onSelectionChange={handleSelectionChange}
>
{suggestions.map((country) => (
<SuggestionItemCustom key={country} text={country}>
<div className="item-content">
<Icon name="globe" />
<Icon name="globe" aria-hidden="true" />
<div className="item-titles">
<span>{country}</span>
<small>EU</small>
Expand Down
Loading