Guidance on advanced customization using a relatively advanced use case #6464
Unanswered
binaryartifex
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Sorry for the delay. Maybe I'm missing the point. I based this codesandbox on one we discussed previously but included a form to show that we do get the date information even though all we display is a button with the current date https://codesandbox.io/p/sandbox/mystifying-fire-4y8h5n?file=%2Fsrc%2FApp.js%3A51%2C35 I think you could hide an entire DateField and, using controlled state, keep it synced with the visible control. So long as you give it a name, it should appear in the form submission. And so long as it's hidden appropriately, it won't appear to assistive technologies, it can just act as the holder of the data. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It'd be fantastic if someone could shine a little light (and even provide a robust example in the docs) of an advanced use case of advanced customisation of react-aria-component's composability. The examples provided in the docs certainly illustrate the idea, particularly the custom number field example. My particular use case stems back to a discussion i had here #4914 requesting code review for what is essentially a DateSelect as opposed to a DatePicker. the suggestion meant giving up on all the niceties that come with RAC components (validation, accessibility, hidden inputs for form submission, etc) so im forced to either hide the picker fields or omit them entirely. So is it possible to leverage the composability of RAC to create something like a DateSelect (a button that triggers a dialog to select a date from a calendar, but holds the intrinsic value of the date in an hidden input field) without sacrificing all the top tier features of a typical RAC form component?
Beta Was this translation helpful? Give feedback.
All reactions