We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This is an idea to make Petal Components more "customizable" by allows users to "expand" JS events inside a component.
For example, the Dropdown component has 2 JS events, phx-click for the trigger button and phx-click-away for the full dropdown.
phx-click
phx-click-away
I was wondering if we could add new attr fields so we can expand these JS events.
attr
For the dropdown, we could have something like this:
attr :click_away_event, JS, default: %JS{} attr :click_event, JS, default: %JS{} ... defp js_attributes("container", "live_view_js", options_container_id, click_away_event) do %{ "phx-click-away": click_away_event |> JS.hide( to: "##{options_container_id}", transition: {@transition_out_base, @transition_out_start, @transition_out_end} ) } end
This would allow the user to do some other actions when the Petal component events are triggered.
The text was updated successfully, but these errors were encountered:
Yeah looks good. Bit busy atm but open to PRs
Sorry, something went wrong.
No branches or pull requests
This is an idea to make Petal Components more "customizable" by allows users to "expand" JS events inside a component.
For example, the Dropdown component has 2 JS events,
phx-click
for the trigger button andphx-click-away
for the full dropdown.I was wondering if we could add new
attr
fields so we can expand these JS events.For the dropdown, we could have something like this:
This would allow the user to do some other actions when the Petal component events are triggered.
The text was updated successfully, but these errors were encountered: