-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom sticky header and footer for popover and tray #3020
Comments
What would header and footer have? Would they be interactive? Purely decorative? Can you make the example a bit more concrete? |
Hi @snowystinger, Both the footer and header should be interactive and we should be able to customize them without affecting the popover and list box layouts. I've updated one of our use cases in the same code sandbox where users should be able to add a new option if it is not present in the list. Thanks! |
Ok, I understand now. We've come across this ask for ComboBoxes before. Now, for the complicated answer. I say it may not be possible because even if you do this, focus should remain in the input, and won't be on the button you want to add. This changes what "Enter" does, and "Enter" has a described behavior in the aria page. I also don't know if it would read the role of the button off correctly for assistive technologies, aria-activedescendent is still quite new and has a number of issues that we work around for you with our ComboBox hooks. These kinds of composite widgets are quite tricky and are being worked on by the aria working group. You can follow some of the discussion around this very use case here: w3c/aria#1454 & w3c/aria#1440 If the above solutions don't work for you, you could drop the pretext of a combobox and instead open a dialog with a list and a form for adding items to the list. |
Okay. Thanks for the information, we'll re-think this and will try to achieve accessibility along with a better user experience with a new design maybe. |
🙋 Feature Request
We have a use case where we need to add a sticky footer without affecting the Listbox layout and scroll. We've explored the
useListboxLayout
and some other hooks that are involved in layout. But didn't help us. Is there any specific thing that we can use for our use case? Thanks!🤔 Expected Behavior
Should be able to add a sticky header and footer in the popover and tray without affecting the layout of the Listbox.
😯 Current Behavior
💁 Possible Solution
A custom item or type of node can be added where we can use it to add a custom header or footer and it shouldn't affect the current layout structure and calculation of the layout dimensions.
🔦 Context
💻 Examples
You can see our use case in the below sandbox:
https://codesandbox.io/s/react-spectrum-listbox-usecase-oztcyl?file=/src/App.tsx:0-34
The text was updated successfully, but these errors were encountered: