-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
Considerations for progressive enhancement #1622
Comments
In terms of using sveltekit's form actions, would it be possible to add an option to the modal to have the primary button be of type submit? or have the buttons as a slot in order to pass in custom buttons. That way we can wrap the modal in a native form and have the whole thing work as intended by sveltekit? |
@gohde absolutely. Though the actual implementation is yet-decided, we'll try to find a way to make the modal's buttons submit as a form. The tricky thing with some modals is they don't open easily without JS, so part of the exploration is to find a pattern that would allow the page to fully refresh without JS and display an opened modal that has a submittable form. |
I had a similar issue with Tabs and ended up solving it using route params. As you tabbed around it would update the url. It worked fine and I don't see why that couldn't work with this also. [[modal]] or with nested or several modals using [...modals]? |
I'm sure it's achievable, I guess I was needlessly concerned with a potential refactor for Modal, but we'll cross that bridge in time. Aspirations include:
|
🚧 Status: Draft 🚧
The following items are needed in order to enable progressive enhancement capabilities for prerendered or server-rendered components:
General: documentation
Add a special section for progressive enhancement, and provide badges for every component that contains explicit support for it. We may also want a checklist system for all components; that way it's clear which components does or does not support certain functionality.
General: Form actions and
href
See #1599
components with an inner button should provide a
formAttributes
prop that is of type{ formAction: fn } | HTMLAttributes<form>
Example:
Underlying component has:
components with inner buttons that can change data or state may receive an
href
prop, allowing users to choose a new page or the same page withsearchParams
, impacting the displayed informationUIShell
WIP
Accordion
WIP
Breakpoint
<Button>
<Button>
can leverage the nativeformaction
attribute to set its individual formaction pathuse:enhance
only applies to<form>
elements (see demo for enhanced button formaction); so we would have to either wrap<Button>
or advise users to provide their own<form>
since<Button>
is a primitive single-element componentModal
WIP
DataTable
WIP
Combobox
WIP
Dropdown
WIP
Tabs
WIP
Toggle
WIP
Tooltip, Tooltip Icon, Tooltip Definition
WIP
Theme
WIP
UIShell
:has
and:active
in order to keep sub-menus open after clicking on them without JS. Otherwise, we'll consider these 'enhanced with JS' and providehref
props to the top-most links, and encourage users to provide index pages for top-level linksTasks
shouldSubmitOnEnter
? #1006The text was updated successfully, but these errors were encountered: