Skip to content

fix: harden close button rendering and refresh docs/examples#315

Open
dusan-maintains wants to merge 1 commit intokylefox:masterfrom
dusan-maintains:maintenance/first-patch
Open

fix: harden close button rendering and refresh docs/examples#315
dusan-maintains wants to merge 1 commit intokylefox:masterfrom
dusan-maintains:maintenance/first-patch

Conversation

@dusan-maintains
Copy link

@dusan-maintains dusan-maintains commented Feb 27, 2026

Summary

  • render closeText as plain text instead of HTML when creating the close button
  • improve ESC close handling by supporting event.key === 'Escape' and guarding null current modal
  • refresh docs/examples CDN snippets and align README option docs with actual defaults

Why

  • reduces injection risk through closeText
  • improves keyboard-close reliability in modern browsers
  • removes stale documentation/examples mismatch

Changes

  • jquery.modal.js
  • README.md
  • examples/index.html

Test Plan

  • open/close modal via close button, ESC, and overlay click
  • set custom closeText containing HTML-like content and verify it renders as text
  • verify docs/examples snippets match current defaults/versions

Compatibility

  • no API changes
  • no option/default behavior changes

@dusan-maintains
Copy link
Author

Maintainer note: I kept this PR intentionally small and backward-compatible. If you prefer, I can split docs/example updates from runtime changes to simplify review.

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