You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Oruga provides mechanisms to enable HTML constraint validation, and it even provides a way to override the browser's validation message when the input is invalid (via the validationMessage prop). However, this validation message only appears if the element fails a native constraint validation check, and it only applies to the messages that Oruga shows; the element's own constraint validation state is unaffected.
It would be convenient to have an officially supported way to call setCustomValidity on Oruga's form control elements. This might either replace or supplement the current validationMessage prop. Just passing a string would likely be sufficient, although I've run into race conditions when trying to update a string prop right before submitting a form, so for that use case, we might need some mechanism to either make the call to setCustomValidity happen faster (e.g. by passing a validation function and attaching a flush: "sync" watcher) or provide an event for which we can wait so we know that constraint validation is in the expected state.
We'd probably also need to hook into the logic that propagates validation messages up to the parent field; any changes in the validation message probably should trigger a call to checkHtml5Validity (perhaps excepting cases where the field is currently focused and was previously valid, as it's less annoying to wait for the user to complete their input before displaying a message).
The text was updated successfully, but these errors were encountered:
[We] might need some mechanism to either make the call to setCustomValidity happen faster (e.g. by passing a validation function and attaching a flush: "sync" watcher) or provide an event for which we can wait so we know that constraint validation is in the expected state.
I suppose this isn't a terrible use case for nextTick.
Currently, Oruga provides mechanisms to enable HTML constraint validation, and it even provides a way to override the browser's validation message when the input is invalid (via the
validationMessage
prop). However, this validation message only appears if the element fails a native constraint validation check, and it only applies to the messages that Oruga shows; the element's own constraint validation state is unaffected.It would be convenient to have an officially supported way to call
setCustomValidity
on Oruga's form control elements. This might either replace or supplement the currentvalidationMessage
prop. Just passing a string would likely be sufficient, although I've run into race conditions when trying to update a string prop right before submitting a form, so for that use case, we might need some mechanism to either make the call tosetCustomValidity
happen faster (e.g. by passing a validation function and attaching aflush: "sync"
watcher) or provide an event for which we can wait so we know that constraint validation is in the expected state.We'd probably also need to hook into the logic that propagates validation messages up to the parent field; any changes in the validation message probably should trigger a call to
checkHtml5Validity
(perhaps excepting cases where the field is currently focused and was previously valid, as it's less annoying to wait for the user to complete their input before displaying a message).The text was updated successfully, but these errors were encountered: