fix(GRANITE-36188): Able to select the date on disabled datepicker #189
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
On loading the UI for datepicker, read-only attribute is added by default during rendering, so if datepicker is disabled and readOnly section is called after that, then the calendar button is marked enabled from readOnly section which should be disabled.
Related Issue
GRANITE-36188: Authors are able to select date on disabled date picker
Motivation and Context
Setting the disabled to true and then readonly to false, reenable the datepicker button which seems to be incorrect. Same goes for readonly to true and then disabled to false.
How Has This Been Tested?
Tested Manually from the browser console by calling readOnly and disabled on the datepicker element.
Screenshots (if appropriate):
Types of changes
Checklist: