Skip to content

Commit 44a8af2

Browse files
committed
fix(MultiSelect): improve default types
1 parent 802058b commit 44a8af2

File tree

4 files changed

+10
-33
lines changed

4 files changed

+10
-33
lines changed

docs/content/forms/multi-select.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,9 @@ You may also choose from small and large multi selects to match our similarly si
230230
| `disabled` | boolean | `false` | Toggle the disabled state for the component. |
231231
| `invalid` | boolean | `false` | Toggle the invalid state for the component. |
232232
| `multiple` | boolean | `true` | It specifies that multiple options can be selected at once. |
233-
| `name` | string | `null` | Set the name attribute for the native select element. |
234-
| `options` | (boolean\|array) | `false` | List of option elements. |
235-
| `optionsMaxHeight` | (number\|string) | `'auto'` | Sets `max-height` of options list. |
233+
| `name` | string, null | `null` | Set the name attribute for the native select element. |
234+
| `options` | boolean, array | `false` | List of option elements. |
235+
| `optionsMaxHeight` | number, string | `'auto'` | Sets `max-height` of options list. |
236236
| `optionsStyle` | string | `'checkbox'` | Sets option style. |
237237
| `placeholder` | string | `'Select...'` | Specifies a short hint that is visible in the input. |
238238
| `search` | boolean | `false` | Enables search input element. |

js/dist/multi-select.js

Lines changed: 5 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/multi-select.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/src/multi-select.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import * as Popper from '@popperjs/core'
99
import BaseComponent from './base-component.js'
1010
import Data from './dom/data.js'
1111
import EventHandler from './dom/event-handler.js'
12-
import Manipulator from './dom/manipulator.js'
1312
import SelectorEngine from './dom/selector-engine.js'
1413
import { defineJQueryPlugin, isRTL } from './util/index.js'
1514

@@ -95,7 +94,7 @@ const DefaultType = {
9594
disabled: 'boolean',
9695
invalid: 'boolean',
9796
multiple: 'boolean',
98-
name: 'string',
97+
name: '(string|null)',
9998
options: '(boolean|array)',
10099
optionsMaxHeight: '(number|string)',
101100
optionsStyle: 'string',
@@ -312,17 +311,6 @@ class MultiSelect extends BaseComponent {
312311
})
313312
}
314313

315-
_getConfig(config) {
316-
config = {
317-
...Default,
318-
...this._element.disabled && { disabled: true },
319-
...Manipulator.getDataAttributes(this._element),
320-
...(typeof config === 'object' ? config : {})
321-
}
322-
323-
return config
324-
}
325-
326314
_getClassNames() {
327315
return this._element.classList.value.split(' ')
328316
}

0 commit comments

Comments
 (0)