Skip to content

Conversation

@0yeifer
Copy link

@0yeifer 0yeifer commented Mar 25, 2025

New Dialog Block Templates Added
Two native <dialog> templates are now available:

  1. Dialog Show:
    • Contains a trigger button with onclick="<dialogId>.showModal()"
    • Modal includes a simple form and three action buttons and one required text input:
      • Validate and Close (form submission via method="dialog" validating input required)
      • Non-Validate Close (submit without validation using attribute formnovalidate)
      • JS Close (native call to close() method via onclick="<dialogId>.close()")
    • Supports native features:
      • Esc key cancellation

Image

  1. Dialog Modal:
    • Open-by-default dialog (open attribute) with confirmation button
    • Demonstrates attribute-driven visibility

Image

Key Implementation Notes:

  • Zero external JS dependencies - uses native HTMLDialogElement methods via ID references
  • Templates maintaining Frappe Builder low-code philosophy

Next Steps:
There is an editor/published view visibility discrepancy that remains unresolved due to the display handling.
Awaiting feedback, I will keep an eye on the PR for any necessary changes.

@0yeifer 0yeifer changed the title feat: Add support for dialog tag and create example templates #330 feat: Add support for dialog tag and create example templates Mar 25, 2025
@0yeifer
Copy link
Author

0yeifer commented Apr 10, 2025

Hello @surajshetty3416 Is there any issue with this PR or something that needs to be changed/improved? I could work on any corrections if needed.

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