duetds / date-picker

Duet Date Picker is an open source version of Duet Design System’s accessible date picker. Try live example at https://duetds.github.io/date-picker/
https://www.duetds.com
MIT License
1.73k stars 68 forks source link

Support for readonly (as opposed to disabled) #114

Open jessevoogt opened 2 years ago

jessevoogt commented 2 years ago

Is your feature request related to a problem? Please describe. In trying to use this control to stand in for a regular text box, and to work like other controls on a page, there are times when a 'readonly' property would be preferred over the 'disabled' property. When a regular input type="text" is disabled, its value will not be sent when submitting the form, and it is not focusable. When it is readonly, its value is sent when submitting the form, and it is focusable, but just not editable. Currently, the duet date picker supports only a 'disabled' property, which behaves mostly like a native 'disabled' property with the exception that there is a hidden field that does get submitted with the value of the control.

Describe the solution you'd like I suggest having both a 'disabled' and a 'readonly' property that mimic the behavior of the native controls as much as possible