@@ -7,6 +7,7 @@ import soundscape from "~brixi/controllers/soundscape";
7
7
import Checkbox from "~brixi/components/checkbox/checkbox" ;
8
8
import { UUID } from "@codewithkyle/uuid" ;
9
9
import Fuse from "fuse.js" ;
10
+ import pos from "~brixi/controllers/pos" ;
10
11
11
12
export type MultiSelectOption = {
12
13
label : string ;
@@ -357,6 +358,12 @@ export default class MultiSelect extends SuperComponent<IMultiSelect> {
357
358
render ( ) {
358
359
const id = `${ this . model . name } -${ this . model . label . replace ( / \s + / g, "-" ) . trim ( ) } ` ;
359
360
this . id = id ;
361
+ this . setAttribute ( "state" , this . state ) ;
362
+ this . className = `multi-select js-input ${ this . model . class } ` ;
363
+ this . style . cssText = this . model . css ;
364
+ Object . keys ( this . model . attributes ) . map ( ( key ) => {
365
+ this . setAttribute ( key , `${ this . model . attributes [ key ] } ` ) ;
366
+ } ) ;
360
367
const selected = this . calcSelected ( ) ;
361
368
const options = this . filterOptions ( ) ;
362
369
this . tabIndex = 0 ;
@@ -386,14 +393,13 @@ export default class MultiSelect extends SuperComponent<IMultiSelect> {
386
393
</ div >
387
394
</ multiselect-options >
388
395
` ;
389
- this . setAttribute ( "state" , this . state ) ;
390
- this . className = `multi-select js-input ${ this . model . class } ` ;
391
- this . style . cssText = this . model . css ;
392
- Object . keys ( this . model . attributes ) . map ( ( key ) => {
393
- this . setAttribute ( key , `${ this . model . attributes [ key ] } ` ) ;
394
- } ) ;
395
396
setTimeout ( ( ) => {
396
397
render ( view , this ) ;
398
+ const options = this . querySelector ( "multiselect-options" ) as HTMLElement ;
399
+ if ( options ) {
400
+ options . style . width = `${ this . scrollWidth } px` ;
401
+ pos . positionElementToElement ( options , this , 8 ) ;
402
+ }
397
403
} , 80 ) ;
398
404
}
399
405
}
0 commit comments