combobox: add a 'mandatory' attribute
authorGalen Charlton <gmc@equinoxOLI.org>
Tue, 1 Jun 2021 21:59:49 +0000 (17:59 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Tue, 1 Jun 2021 21:59:49 +0000 (17:59 -0400)
This is a synonym of the 'required' attribute, as overloading
the HTML5 required attribute can lead the colored left border
indicated the state of the weidget extending to the container
of the combobox

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts

index 96c15fa..5024189 100644 (file)
@@ -74,6 +74,14 @@ export class ComboboxComponent implements ControlValueAccessor, OnInit, AfterVie
     @Input() set required(r: boolean) {
         this.isRequired = r;
     }
+    // and a 'mandatory' synonym, as an issue
+    // has been observed in at least Firefox 88.0.1
+    // where the left border indicating whether a required
+    // value has been set or not is displayed in the
+    // container of the combobox, not just the dropdown
+    @Input() set mandatory(r: boolean) {
+        this.isRequired = r;
+    }
 
     // Disable the input
     isDisabled: boolean;