Skip to content

Commit 272920f

Browse files
committed
IBX-6343: ezdate and ezdatetime validation is styled properly
1 parent 91d572f commit 272920f

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

src/bundle/Resources/public/js/scripts/fieldType/ezdate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const SELECTOR_INPUT = '.ibexa-data-source__input:not(.flatpickr-input)';
44
const SELECTOR_FLATPICKR_INPUT = '.flatpickr-input';
55
const EVENT_VALUE_CHANGED = 'change';
6-
const SELECTOR_ERROR_NODE = '.ibexa-data-source';
6+
const SELECTOR_ERROR_NODE = '.ibexa-form-error';
77

88
class EzDateValidator extends ibexa.BaseFieldValidator {
99
/**

src/bundle/Resources/public/js/scripts/fieldType/ezdatetime.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const SELECTOR_INPUT = '.ibexa-data-source__input[data-seconds]';
44
const SELECTOR_FLATPICKR_INPUT = '.flatpickr-input';
55
const EVENT_VALUE_CHANGED = 'change';
6-
const SELECTOR_ERROR_NODE = '.ibexa-data-source';
6+
const SELECTOR_ERROR_NODE = '.ibexa-form-error';
77
const { convertDateToTimezone } = ibexa.helpers.timezone;
88

99
class EzDateTimeValidator extends ibexa.BaseFieldValidator {

src/bundle/Resources/public/scss/_mixins.scss

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,23 @@
1313
@import 'mixins/drag-and-drop';
1414

1515
@mixin datetime-field() {
16+
&.is-invalid {
17+
.ibexa-label {
18+
color: $ibexa-color-danger;
19+
}
20+
21+
.ibexa-input-text-wrapper__action-btn {
22+
.ibexa-icon {
23+
fill: $ibexa-color-danger;
24+
}
25+
}
26+
27+
.ibexa-data-source__input {
28+
border: calculateRem(1px) solid $ibexa-color-danger;
29+
background: $ibexa-color-danger-100;
30+
}
31+
}
32+
1633
.ibexa-data-source__input-wrapper {
1734
max-width: 30ch;
1835
position: relative;
@@ -98,7 +115,7 @@
98115

99116
.ibexa-data-source__input {
100117
border: calculateRem(1px) solid $ibexa-color-danger;
101-
background: $ibexa-color-warning-pale;
118+
background: $ibexa-color-danger-100;
102119
}
103120
}
104121
}

0 commit comments

Comments
 (0)