Skip to content

Commit

Permalink
Disable the "Ok" button for empty strings
Browse files Browse the repository at this point in the history
Fixes #104131
  • Loading branch information
Aditya Thakral committed Aug 7, 2020
1 parent 42a9a99 commit 20cba51
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -780,6 +780,7 @@ export class ObjectSettingWidget extends AbstractListSettingWidget<IObjectDataIt
const changedItem = { ...item };
const onKeyChange = (key: ObjectKey) => {
changedItem.key = key;
okButton.enabled = key.data !== '';

const suggestedValue = this.valueSuggester(key.data) ?? item.value;

Expand Down Expand Up @@ -843,6 +844,7 @@ export class ObjectSettingWidget extends AbstractListSettingWidget<IObjectDataIt
rowElement.append(keyElement, valueContainer);

const okButton = this._register(new Button(rowElement));
okButton.enabled = changedItem.key.data !== '';
okButton.label = localize('okButton', "OK");
okButton.element.classList.add('setting-list-ok-button');

Expand Down

0 comments on commit 20cba51

Please sign in to comment.