fix: revert change from readonly to disabled on liaison from contact (#4708)
* feat: apply 'readonly' property to select2 inputs * fix: revert change from readonly to disabled on liaison from contact
This commit is contained in:
parent
d7f5c20a28
commit
331bf8d2dc
|
@ -510,7 +510,7 @@ class OutgoingLiaisonForm(LiaisonModelForm):
|
||||||
else:
|
else:
|
||||||
email = self.person.email_address()
|
email = self.person.email_address()
|
||||||
self.fields['from_contact'].initial = email
|
self.fields['from_contact'].initial = email
|
||||||
self.fields['from_contact'].widget.attrs['disabled'] = True
|
self.fields['from_contact'].widget.attrs['readonly'] = True
|
||||||
|
|
||||||
def set_to_fields(self):
|
def set_to_fields(self):
|
||||||
'''Set to_groups and to_contacts options and initial value based on user
|
'''Set to_groups and to_contacts options and initial value based on user
|
||||||
|
|
|
@ -3,3 +3,21 @@
|
||||||
@import "bootstrap/scss/mixins";
|
@import "bootstrap/scss/mixins";
|
||||||
@import "select2/src/scss/core";
|
@import "select2/src/scss/core";
|
||||||
@import "select2-bootstrap-5-theme/src/include-all";
|
@import "select2-bootstrap-5-theme/src/include-all";
|
||||||
|
|
||||||
|
// Propagate readonly property from input to select2 instrumentation, based on
|
||||||
|
// https://stackoverflow.com/questions/41807096/select2-make-it-readonly-not-disabled-from-js/55001516#55001516
|
||||||
|
select[readonly].select2-hidden-accessible + .select2-container {
|
||||||
|
pointer-events: none;
|
||||||
|
touch-action: none;
|
||||||
|
|
||||||
|
.select2-selection {
|
||||||
|
background: $form-select-disabled-bg;
|
||||||
|
color: $form-select-disabled-color;
|
||||||
|
border-color: $form-select-disabled-border-color;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-selection__arrow, .select2-selection__clear {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue