File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -51,11 +51,11 @@ export class ButtonComponent extends ColoredComponent {
5151 } ) ;
5252 return this ;
5353 }
54- setAlignContent ( type : "center" | "end" | "start" | "stretch" ) {
54+ setAlignContent ( type : "center" | "end" | "start" | "stretch" | "space-around" | "space-between" | "space-evenly" ) {
5555 this . wrapper . style . alignContent = type ;
5656 return this ;
5757 }
58- setJustifyContent ( type : "center" | "end" | "start" | "stretch" ) {
58+ setJustifyContent ( type : "center" | "end" | "start" | "stretch" | "space-around" | "space-between" | "space-evenly" ) {
5959 this . wrapper . style . justifyContent = type ;
6060 return this ;
6161 }
Original file line number Diff line number Diff line change @@ -77,7 +77,10 @@ export class DropDownInputComponent<Value extends string> extends InputForm<Valu
7777 super ( ) ;
7878
7979 const text = asRef ( label ) ;
80- this . button = Button ( text ) . addSuffix ( icon ) ;
80+ this . button = Button ( text )
81+ . setWidth ( "100%" )
82+ . setJustifyContent ( "space-between" )
83+ . addSuffix ( icon ) ;
8184
8285 this . wrapper . innerHTML = "" ;
8386 this . color . setValue ( Color . Disabled ) ;
@@ -91,6 +94,10 @@ export class DropDownInputComponent<Value extends string> extends InputForm<Valu
9194 } ) ;
9295
9396 this . button . onClick ( ( ) => {
97+ if ( dropDownPopover . isOpen ( ) ) {
98+ dropDownPopover . hidePopover ( ) ;
99+ return ;
100+ }
94101 dropDownPopover . clearAnchors ( "--wdropdown-default" ) ;
95102 this . button . setAnchorName ( "--wdropdown-default" ) ;
96103 dropDownPopover . showPopover ( ) ;
Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ export const Popover = (content: Component) => new class extends Component {
3434 return this ;
3535 } ;
3636
37+ public isOpen ( ) {
38+ return this . wrapper . matches ( ':popover-open' ) ;
39+ }
40+
3741 public clearAnchors ( anchorName : `--${string } `) {
3842 const anchors = document . querySelectorAll ( `[anchor="${ anchorName } "]` ) ;
3943 anchors . forEach ( anchor => anchor . removeAttribute ( "anchor" ) ) ;
You can’t perform that action at this time.
0 commit comments