-
Notifications
You must be signed in to change notification settings - Fork 381
Description
What is the feature request? Please describe.
Frappe Builder currently lacks to allow selecting the HTML <dialog> element from the list of tags for a block. Users might implement modal windows and interactive dialogs through non-semantic <div> structures with manual JavaScript handling, but, this approach complicates accessibility, increases code complexity, and limits the use of native browser features like built-in focus management and backdrop styling.
How would I like the solution to work?
- Native Integration: Add
<dialog>as a selectable tag for a block in the Frappe Builder UI, allowing users to configure its owns javascript methods if they want to handle interactions. - Zero-JS Templates: Provide a prebuilt dialog template demonstrating native functionality (e.g., a modal that opens via
<button onclick="dialog.showModal()">and closes via<button onclick="dialog.close()">).
Why have I considered this request?
As an alternative, I’ve used <div>-based modals with custom JavaScript for focus trapping and styling. However, this approach introduces accessibility risks, conflicts with Frappe Builder’s low-code philosophy, and requires unnecessary maintenance. The native <dialog> element aligns with Frappe’s performance goals by leveraging browser-native features and reducing third-party dependencies.
Who can contribute or support this request, and how?
- My Contribution: I’ve already prototyped the integration logic and template structure. I will submit a PR soon and wait for feedback.
- Official Documentation: MDN Web Docs (official
<dialog>documentation) provides detailed guidance on<dialog>usage, including keyboard navigation, focus management, and styling. This resource can inform Frappe Builder’s native dialog implementation.
When and where would the solution be available?
There doesn't seem to found any specific constraints on the availability of this feature. Maybe it can be available in the next release of Frappe Builder. I will address these issues in the PR and collaborate with the team to refine the solution.
Additional context
Why <dialog> Matters for Frappe Builder:
- ✅ Native browser focus management improves Lighthouse accessibility scores.
- ✅ Eliminates redundant JavaScript for basic modal interactions.
- ✅ Accessible by default, supporting keyboard navigation and screen readers.
I will share progress in comments and propose template designs for review.
