diff --git a/e2e/select-field.e2e-spec.ts b/e2e/select-field.e2e-spec.ts index e57f284..3dbae69 100644 --- a/e2e/select-field.e2e-spec.ts +++ b/e2e/select-field.e2e-spec.ts @@ -21,6 +21,15 @@ describe('Select field', () => { expect('#screenshot-select-field-single-mode').toMatchBaselineScreenshot(done); }); + it('should match previous single mode screenshot with validation', (done) => { + element(by.css('#screenshot-select-field-single-mode .sky-input-group.sky-btn')).click(); + element(by.css('.sky-modal-btn-close')).click(); + SkyHostBrowser.moveCursorOffScreen(); + expect('#screenshot-select-field-single-mode-wrapper').toMatchBaselineScreenshot(done, { + screenshotName: 'select-field-single-mode-validation' + }); + }); + it('should match previous multiple mode selected screenshot', (done) => { element(by.css('#select-field-populate-selected-btn')).click(); expect('#screenshot-select-field-multiple-mode').toMatchBaselineScreenshot(done); diff --git a/src/app/public/modules/select-field/select-field.component.ts b/src/app/public/modules/select-field/select-field.component.ts index 0d7dbc7..e52bc87 100644 --- a/src/app/public/modules/select-field/select-field.component.ts +++ b/src/app/public/modules/select-field/select-field.component.ts @@ -179,6 +179,7 @@ export class SkySelectFieldComponent implements ControlValueAccessor { this.writeValue(result.data); } } + this.onTouched(); }); }); } @@ -197,9 +198,9 @@ export class SkySelectFieldComponent implements ControlValueAccessor { // Angular automatically constructs these methods. /* istanbul ignore next */ - public onChange = (value: any) => {}; + public onChange = (value: any) => { }; /* istanbul ignore next */ - public onTouched = () => {}; + public onTouched = () => { }; public registerOnChange(fn: (value: any) => void) { this.onChange = fn; diff --git a/src/app/visual/select-field/select-field-visual.component.html b/src/app/visual/select-field/select-field-visual.component.html index eed590a..6f02bac 100644 --- a/src/app/visual/select-field/select-field-visual.component.html +++ b/src/app/visual/select-field/select-field-visual.component.html @@ -1,12 +1,16 @@ - -
- - +
+
+
+ + +
+