Skip to content

onClick action for selectable items#493

Open
GabrielCW wants to merge 4 commits intomike-north:masterfrom
GabrielCW:actionable_checkbox
Open

onClick action for selectable items#493
GabrielCW wants to merge 4 commits intomike-north:masterfrom
GabrielCW:actionable_checkbox

Conversation

@GabrielCW
Copy link
Copy Markdown

See #492 for the original issue.

Basically, this adds the possibility of passing a click action to selectable items, an action which - contrarily to the default click action - only fires once.
It must be called onClick (overrinding click just breaks the components, understandably).

There's not much to the implementation here, except for this strange variable clickActionWasSent. It is required because the click event fires twice, and ideally the action passed to the input should only be called once (that's what users will expect).

I couldn't write unit tests for this. I'm not unwilling, but I don't really know where to start. I'm not used to writing tests (shame on me), but I'll totally do it if someone gives me a few pointers on how to do it.

Outside of that, the test suite is green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant