Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui/ux: styling input validation #12585

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/playwright/src/theia-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export class TheiaDialog extends TheiaPageObject {
protected titleSelector = this.titleBarSelector + ' > div';
protected contentSelector = this.blockSelector + ' .dialogContent > div';
protected controlSelector = this.blockSelector + ' .dialogControl';
protected errorSelector = this.blockSelector + ' .dialogContent';

async waitForVisible(): Promise<void> {
await this.page.waitForSelector(`${this.blockSelector}`, { state: 'visible' });
Expand Down Expand Up @@ -64,7 +65,7 @@ export class TheiaDialog extends TheiaPageObject {
}

protected async validationElement(): Promise<ElementHandle<SVGElement | HTMLElement>> {
return this.page.waitForSelector(`${this.controlSelector} div.error`);
return this.page.waitForSelector(`${this.errorSelector} div.error`, { state: 'attached' });
}

async getValidationText(): Promise<string | null> {
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/browser/dialogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,10 @@ export class SingleTextInputDialog extends AbstractDialog<string> {
} else {
this.inputField.select();
}

this.contentNode.appendChild(this.inputField);
this.controlPanel.removeChild(this.errorMessageNode);
this.contentNode.appendChild(this.errorMessageNode);

this.appendAcceptButton(props.confirmButtonLabel);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/keymaps/src/browser/keybindings-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ export class KeybindingWidget extends ReactWidget implements StatefulWidget {
const binding = { command, keybinding };
KeySequence.parse(keybinding);
if (oldKeybinding === keybinding) {
return ' '; // if old and new keybindings match, quietly reject update
return ''; // if old and new keybindings match, quietly reject update
}
if (this.keybindingRegistry.containsKeybindingInScope(binding)) {
return nls.localize('theia/keymaps/keybindingCollidesValidation', 'keybinding currently collides');
Expand Down
10 changes: 4 additions & 6 deletions packages/preferences/src/browser/style/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@

.theia-settings-container .theia-input[type="checkbox"]:focus,
.theia-settings-container .theia-input[type="number"]:focus {
outline-width: 2px;
outline-width: 1px;
}

.theia-settings-container .theia-input[type="checkbox"] {
Expand All @@ -404,12 +404,10 @@
margin: 0;
}

.theia-settings-container
.pref-content-container
.pref-input
.pref-input-container
.pref-error-notification {
.dialogContent .error:not(:empty),
.theia-settings-container .pref-content-container .pref-input .pref-input-container .pref-error-notification {
border-style: solid;
border-width: 1px;
border-color: var(--theia-inputValidation-errorBorder);
background-color: var(--theia-inputValidation-errorBackground);
width: 100%;
Expand Down