File tree Expand file tree Collapse file tree 4 files changed +61
-11
lines changed
projects/ngx-formidable/src/lib Expand file tree Collapse file tree 4 files changed +61
-11
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ Improvements:
2222- rename FormDirective to NgxFormidableFormDirective. (no naming clash with Angular)
2323- in tokens, use var(--formidable-...) instead of $formidable...?
2424- keyboard-navigation: skip disabled/readonly options
25- - don't show field (group) focus border when field is readonly or disabled
25+ - don't make fields tabbable when readonly/ disabled
2626
2727# Bugs:
2828
Original file line number Diff line number Diff line change 33:host {
44 display : block ;
55
6- & :not (.disabled ):not (.readonly ) {
6+ & :not (.readonly ):not (.disabled ) {
77 & .selected {
88 @include field-option-selected ;
99 }
Original file line number Diff line number Diff line change 168168 width : 100% ;
169169 position : relative ;
170170
171+ & [readonly ] {
172+ pointer-events : auto ;
173+ }
174+
171175 & [disabled ] {
172- cursor : not-allowed ;
173176 pointer-events : none ;
174177 user-select : none ;
175178 }
182185 @include disabled-colors ;
183186 }
184187
185- & :focus ,
186- & .focused ,
187- & :focus-visible {
188- @include focused-colors ;
188+ // use native [readonly] and [disabled] attributes
189+ & :not ([readonly ]):not ([disabled ]) {
190+ & :focus ,
191+ & .focused ,
192+ & :focus-visible {
193+ @include focused-colors ;
194+ }
189195 }
190196}
191197
203209 @include disabled-colors ;
204210 }
205211
206- & :focus ,
207- & .focused ,
208- & :focus-visible {
209- @include focused-group-colors ;
212+ // use custom .is-readonly and .is-disabled classes
213+ & :not (.is-readonly ):not (.is-disabled ) {
214+ & :focus ,
215+ & .focused ,
216+ & :focus-visible {
217+ @include focused-group-colors ;
218+ }
210219 }
211220}
212221
Original file line number Diff line number Diff line change @@ -240,6 +240,47 @@ <h4>Log Output</h4>
240240 </ div >
241241 </ formidable-field-decorator >
242242
243+ <!-- Last Name -->
244+ < formidable-field-decorator >
245+ < formidable-input-field
246+ formidableFieldErrors
247+ placeholder ="Your last name "
248+ name ="lastName "
249+ [readonly] ="false "
250+ [disabled] ="false "
251+ [minLength] ="15 "
252+ [maxLength] ="15 "
253+ [ngModel] ="vm.formValue$.lastName "
254+ (valueChanged) ="onValueChanged('lastName', $event) "
255+ (focusChanged) ="onFocusChanged('lastName', $event) ">
256+ </ formidable-input-field >
257+ < div
258+ *ngIf ="controlCenter.showLabels "
259+ formidableFieldLabel
260+ [isFloating] ="controlCenter.floatingLabels ">
261+ Last Name
262+ </ div >
263+ < div
264+ *ngIf ="controlCenter.showTooltips "
265+ formidableFieldTooltip >
266+ < example-tooltip
267+ placement ="right "
268+ trigger ="hover "
269+ [text] ="'Fields can be masked, and have prefixes and suffixes.' ">
270+ </ example-tooltip >
271+ </ div >
272+ < div
273+ *ngIf ="controlCenter.showPrefixes "
274+ formidableFieldPrefix >
275+ Prefix
276+ </ div >
277+ < div
278+ *ngIf ="controlCenter.showSuffixes "
279+ formidableFieldSuffix >
280+ Suffix
281+ </ div >
282+ </ formidable-field-decorator >
283+
243284 <!-- Last Name -->
244285 <!-- <formidable-field-decorator>
245286 <formidable-textarea-field
You can’t perform that action at this time.
0 commit comments