openui / open-ui

Maintain an open standard for UI and promote its adherence and adoption.
https://open-ui.org
Other
3.57k stars 192 forks source link

[invokers] `invokeaction=set/reset/clear` for form inputs #1038

Open ryantownsend opened 6 months ago

ryantownsend commented 6 months ago

It's great that we've got stepUp/stepDown for number inputs, but in addition to this I'd like to propose a set and possibly reset or clear for form inputs (set with an empty value could work for clear and set with an 'original' value could work for reset so all 3 may not be necessary)

My use-case is having a bunch of filters on an ecommerce website. Outside the filter form (that might be buried in a closed <dialog>), there's a list of active filters, providing quick-access for the user to remove them and widen the search.

For the checkbox filters, I can use <label for="[checkbox-id]"> to uncheck the filters, however with the price filter (two number inputs), there's no way to clear their values without manual JavaScript (afaik), <button invoketarget="[input-id]" invokeaction="set" value=""> would work wonders for this and provide an extensible mechanism to reset/clear individual inputs and no doubt apply to a bunch of other use-cases given that any value could be set.

(sorry if this has already been proposed, I couldn't find anything in the Github issue search!)

github-actions[bot] commented 1 week ago

There hasn't been any discussion on this issue for a while, so we're marking it as stale. If you choose to kick off the discussion again, we'll remove the 'stale' label.

ryantownsend commented 6 days ago

@keithamus is there anywhere I need to follow this up? (if not, ignore this, just bumping to prevent stale bot closing)