-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Dialog on_cancel #101
Dialog on_cancel #101
Conversation
Dialog with the same behavior that the modal core component of phoenix. In the case the user pass the on_cancel attribute it will execute the JS and then the phx-remove. If the user don't pass we will keep the same behavior
Reviewer's Guide by SourceryThis PR modifies the Dialog component to support an optional Sequence diagram for Dialog on_cancel behaviorsequenceDiagram
actor User
participant Dialog
participant JS
User->>Dialog: Trigger escape key or click-away
alt on_cancel is provided
Dialog->>JS: Execute on_cancel
JS-->>Dialog: on_cancel executed
end
Dialog->>JS: Execute phx-remove
JS-->>Dialog: phx-remove executed
Dialog-->>User: Dialog removed
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @DamascenoV - I've reviewed your changes - here's some feedback:
Overall Comments:
- Please add tests to verify the new on_cancel callback behavior, including cases with and without the callback provided
- Consider adding documentation for the new on_cancel attribute to help other developers understand its usage
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
LGTM |
Dialog with the same behavior that the modal core component of phoenix. In the case the user pass the on_cancel attribute it will execute the JS and then the phx-remove.
If the user don't pass we will keep the same behavior.
Before:
Gravacao.2024-12-06.183902.mp4
After:
Gravacao.2024-12-06.184308.mp4
Summary by Sourcery
New Features: