From 89a500e5236da0b0013646d494dae4ce5aaed02a Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Fri, 19 Feb 2021 15:58:24 -0800 Subject: [PATCH] feat(multi-select): add direction prop --- COMPONENT_INDEX.md | 1 + docs/src/COMPONENT_API.json | 10 ++++++++++ docs/src/pages/components/MultiSelect.svx | 10 ++++++++++ src/MultiSelect/MultiSelect.svelte | 9 ++++++++- tests/MultiSelect.test.svelte | 1 + types/MultiSelect/MultiSelect.d.ts | 6 ++++++ 6 files changed, 36 insertions(+), 1 deletion(-) diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index 97627bb2..8b970752 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -2156,6 +2156,7 @@ export interface MultiSelectItem { | itemToString | let | No | (item: MultiSelectItem) => string | (item) => item.text || item.id | Override the display of a multiselect item | | size | let | No | "sm" | "lg" | "xl" | -- | Set the size of the combobox | | type | let | No | "default" | "inline" | "default" | Specify the type of multiselect | +| direction | let | No | "bottom" | "top" | "bottom" | Specify the direction of the multiselect dropdown menu | | selectionFeedback | let | No | "top" | "fixed" | "top-after-reopen" | "top-after-reopen" | Specify the selection feedback after selecting items | | disabled | let | No | boolean | false | Set to `true` to disable the dropdown | | filterable | let | No | boolean | false | Set to `true` to filter items | diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index ea9ad857..34654213 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -5182,6 +5182,16 @@ "constant": false, "reactive": false }, + { + "name": "direction", + "kind": "let", + "description": "Specify the direction of the multiselect dropdown menu", + "type": "\"bottom\" | \"top\"", + "value": "\"bottom\"", + "isFunction": false, + "constant": false, + "reactive": false + }, { "name": "selectionFeedback", "kind": "let", diff --git a/docs/src/pages/components/MultiSelect.svx b/docs/src/pages/components/MultiSelect.svx index 41daaa33..3ac22723 100644 --- a/docs/src/pages/components/MultiSelect.svx +++ b/docs/src/pages/components/MultiSelect.svx @@ -51,6 +51,16 @@ Use the `itemToString` prop to format the display of individual items. sortItem="{() => {}}" /> +### Top direction + +Set `direction` to `"top"` for the dropdown menu to appear above the input. + + + ### Light variant