@@ -851,14 +851,17 @@ export class IAComboBox extends LitElement {
851851
852852 openOptionsMenu ( ) : void {
853853 this . open = true ;
854+ this . emitToggleEvent ( ) ;
854855 }
855856
856857 closeOptionsMenu ( ) : void {
857858 this . open = false ;
859+ this . emitToggleEvent ( ) ;
858860 }
859861
860862 toggleOptionsMenu ( ) : void {
861863 this . open = ! this . open ;
864+ this . emitToggleEvent ( ) ;
862865 }
863866
864867 private updateFormValidity ( ) : void {
@@ -881,6 +884,14 @@ export class IAComboBox extends LitElement {
881884 ) ;
882885 }
883886
887+ private emitToggleEvent ( ) : void {
888+ this . dispatchEvent (
889+ new CustomEvent < boolean > ( 'toggle' , {
890+ detail : this . open ,
891+ } ) ,
892+ ) ;
893+ }
894+
884895 //
885896 // HELPERS
886897 //
@@ -904,7 +915,7 @@ export class IAComboBox extends LitElement {
904915 const optionsListStyles : Record < string , string > = {
905916 top : `${ mainWidgetRect . bottom + scrollY } px` ,
906917 left : `${ mainWidgetRect . left + scrollX } px` ,
907- width : `${ mainWidgetRect . width } px` ,
918+ width : `var(--comboBoxListWidth, ${ mainWidgetRect . width } px) ` ,
908919 maxHeight : `min(${ usableHeightBelow } px, ${ maxHeightVar } )` ,
909920 } ;
910921
@@ -1039,7 +1050,7 @@ export class IAComboBox extends LitElement {
10391050 /**
10401051 * The IAComboBoxOption that is currently selected, or null if none is selected.
10411052 */
1042- private get selectedOption ( ) : IAComboBoxOption | null {
1053+ get selectedOption ( ) : IAComboBoxOption | null {
10431054 if ( this . value == null ) return null ;
10441055 return this . getOptionFor ( this . value ) ;
10451056 }
@@ -1074,6 +1085,7 @@ export class IAComboBox extends LitElement {
10741085 align-items : stretch;
10751086 flex-wrap : nowrap;
10761087 background : white;
1088+ border : 1px solid black;
10771089 }
10781090
10791091 .focused # main-widget-row {
@@ -1086,6 +1098,7 @@ export class IAComboBox extends LitElement {
10861098 background : transparent;
10871099 border : none;
10881100 padding : var (--comboBoxPadding , 5px );
1101+ width : 100% ;
10891102 font-size : inherit;
10901103 outline : none;
10911104 }
0 commit comments