Skip to content
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

Add RenameButton and renameAction #326

Merged
merged 2 commits into from
Mar 3, 2023
Merged

Add RenameButton and renameAction #326

merged 2 commits into from
Mar 3, 2023

Conversation

carson-katri
Copy link
Contributor

This adds the rename-button View and associated rename_action modifier. When clicked, the button will trigger the event specified by rename_action, which can be declared on any of its parent Views.

Note Support for the target option is waiting on #166

Alternatively, <rename-button> could be implemented with the event being specified on its element with phx-click. However, this deviates from how SwiftUI declares this type of button. I assume they designed it like this because rename buttons often appear in multiple places but should trigger the same action?

<text>
  <%= if @is_on do %>
    Renaming
  <% else %>
    Not Renaming
  <% end %>
</text>
<v-stack modifiers={@native |> rename_action(event: "rename")}>
  <rename-button />
</v-stack>
Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-03-03.at.09.57.49.mp4

@carson-katri carson-katri merged commit db984e8 into main Mar 3, 2023
@carson-katri carson-katri deleted the rename-button branch March 3, 2023 19:28
@carson-katri carson-katri linked an issue Apr 6, 2023 that may be closed by this pull request
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants