Skip to content

Commit

Permalink
Update AbstractVirtualSelect.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
gnbm committed Sep 5, 2023
1 parent 2628f9e commit f79c49b
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,16 @@ namespace Providers.OSUI.Dropdown.VirtualSelect {

// Manage the attributes to be added
private _manageAttributes(): void {
// Check if the pattern should be in disabled mode
this._manageDisableStatus();

// Manage A11Y attributes
this.setA11YProperties();
}

// Manage the disable status of the pattern
private _manageDisableStatus(): void {
if (this.configs.IsDisabled) {
OSFramework.OSUI.Helper.Dom.Attribute.Set(
this.selfElement,
OSFramework.OSUI.GlobalEnum.HTMLAttributes.Disabled,
''
);
this.provider.$ele.disable();
} else {
OSFramework.OSUI.Helper.Dom.Attribute.Remove(
this.selfElement,
OSFramework.OSUI.GlobalEnum.HTMLAttributes.Disabled
);
this.provider.$ele.enable();
}
}

Expand Down Expand Up @@ -275,6 +265,8 @@ namespace Providers.OSUI.Dropdown.VirtualSelect {
if (this.isBuilt) {
switch (propertyName) {
case OSFramework.OSUI.Patterns.Dropdown.Enum.Properties.IsDisabled:
this._manageDisableStatus();
break;
case Enum.Properties.NoOptionsText:
case Enum.Properties.NoResultsText:
case Enum.Properties.OptionsList:
Expand Down

0 comments on commit f79c49b

Please sign in to comment.