From fd09f652d450580d7ad43d2c4466cb4ed42d30f0 Mon Sep 17 00:00:00 2001 From: gerjanvangeest Date: Thu, 29 Dec 2022 10:37:40 +0100 Subject: [PATCH] fix(select-rich): solve case of having singleOption and hassNoDefaultSelected at the same time (#1863) --- .changeset/chilly-taxis-sin.md | 5 +++++ packages/ui/components/listbox/src/ListboxMixin.js | 4 ---- .../components/listbox/types/ListboxMixinTypes.ts | 5 +---- .../ui/components/select-rich/src/LionSelectRich.js | 2 +- .../select-rich/test/lion-select-rich.test.js | 13 +++++++++++++ 5 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 .changeset/chilly-taxis-sin.md diff --git a/.changeset/chilly-taxis-sin.md b/.changeset/chilly-taxis-sin.md new file mode 100644 index 000000000..bed13de75 --- /dev/null +++ b/.changeset/chilly-taxis-sin.md @@ -0,0 +1,5 @@ +--- +'@lion/ui': patch +--- + +[select-rich] solve case of having singleOption and hasNoDefaultSelected as the same time diff --git a/packages/ui/components/listbox/src/ListboxMixin.js b/packages/ui/components/listbox/src/ListboxMixin.js index 084b47ac6..9ac4f8eac 100644 --- a/packages/ui/components/listbox/src/ListboxMixin.js +++ b/packages/ui/components/listbox/src/ListboxMixin.js @@ -384,10 +384,6 @@ const ListboxMixinImplementation = superclass => updated(changedProperties) { super.updated(changedProperties); - if (this.formElements.length === 1) { - this.singleOption = true; - } - if (changedProperties.has('disabled')) { if (this.disabled) { this.__requestOptionsToBeDisabled(); diff --git a/packages/ui/components/listbox/types/ListboxMixinTypes.ts b/packages/ui/components/listbox/types/ListboxMixinTypes.ts index 7cc3bcb15..43c635c6c 100644 --- a/packages/ui/components/listbox/types/ListboxMixinTypes.ts +++ b/packages/ui/components/listbox/types/ListboxMixinTypes.ts @@ -11,7 +11,7 @@ import { LionOption } from '../src/LionOption.js'; export declare class ListboxHost { static get styles(): CSSResultArray; /** - * When true, will synchronize activedescendant and selected element on + * When true, will synchronize active descendant and selected element on * arrow key navigation. * This behavior can usually be seen on