Skip to content

Commit aef4c64

Browse files
committed
feat: add new property fitPositionTarget to fit content width to container
1 parent 978db91 commit aef4c64

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/AnypointDropdownMenu.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export class AnypointDropdownMenu extends ValidatableMixin(
4949
_infoAddonClass,
5050
_triggerClass,
5151
_inputContainerClass,
52+
fitPositionTarget,
5253
} = this;
5354

5455
const renderValue = value || '';
@@ -79,6 +80,7 @@ export class AnypointDropdownMenu extends ValidatableMixin(
7980
</div>
8081
8182
<anypoint-dropdown
83+
fitPositionTarget="${fitPositionTarget}"
8284
.opened="${opened}"
8385
.horizontalAlign="${horizontalAlign}"
8486
.verticalAlign="${verticalAlign}"
@@ -522,6 +524,11 @@ export class AnypointDropdownMenu extends ValidatableMixin(
522524
* When set the control is rendered as disabled form control.
523525
*/
524526
disabled: { type: Boolean, reflect: true },
527+
/**
528+
* It will fit dropdown content width to dropdown selector
529+
* Default value is false.
530+
*/
531+
fitPositionTarget: { type: Boolean },
525532
};
526533
}
527534

@@ -543,6 +550,7 @@ export class AnypointDropdownMenu extends ValidatableMixin(
543550
this.infoMessage = undefined;
544551
this.noLabelFloat = false;
545552
this.required = false;
553+
this.fitPositionTarget = false;
546554

547555
this._clickHandler = this._clickHandler.bind(this);
548556
this._onKeydown = this._onKeydown.bind(this);

0 commit comments

Comments
 (0)