New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ewc-lib/ewc-dialog

Package Overview
Dependencies
Maintainers
0
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ewc-lib/ewc-dialog - npm Package Compare versions

Comparing version 2.0.6-alpha to 2.0.7-alpha

2

package.json
{
"name": "@ewc-lib/ewc-dialog",
"version": "2.0.6-alpha",
"version": "2.0.7-alpha",
"description": "",

@@ -5,0 +5,0 @@ "main": "src/main.js",

@@ -67,1 +67,15 @@ # Screenshot

import "@ewc-lib/ewc-dialog"
# Focus trap
If bodyHtml contains elements which should be included in the focus trap - for example links - there's the possibility to set the focus trap's last element (to the last focusable element from the body html) - after which the first element (the close button) is focussed again, completing a cycle.
Example:
document.getElementById("infoModal").bodyHtml = `<a id="dialog_last_element" href="https://ec.europa.eu/eurostat" title="Link to Estat">Some Link Text</a>`
document.getElementById("infoModal").visible = true
document.getElementById("infoModal").focusTrap.setLastElement(document.getElementById("dialog_last_element") )
This way, the focus is still trapped within the dialog but also includes tab-focusable elements within the bodyHtml.
Note that setLastElement() is called **after** the visible setter.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc