question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

showModal throws exception when dialog is inside a custom-element

See original GitHub issue

I have a large web-components (using lit-element) application. It will be used in a very closed environment, so I am able to control the browser support. So far its been used exclusively with chrome.

I do use the <dialog> element inside a few components, and built in the use of the polyfill from the beginning. These elements exclusively use showModal() to open dialogs when needed.

I have been asked to check for IOS support on ipads - but with them it has been impossible to debug why things didn’t work, so I just starting using Safari on the mac.

However using the debugger on my mac with Safari I have discovered that showModal() tries to check whether the dialog exists by doing a document.body.contains(this.dialog_) call. Node.contains() doesn’t include elements inside the shadowRoot of a contained element, so the call throws an exception.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:14 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
samthorcommented, Apr 10, 2020

I’ve published 0.5.1 which includes this.

On Fri, 10 Apr 2020 at 20:48, Adrian Nita notifications@github.com wrote:

@samthor https://github.com/samthor please check pull request #194 https://github.com/GoogleChrome/dialog-polyfill/pull/194 that fixes this issue. Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/GoogleChrome/dialog-polyfill/issues/186#issuecomment-611981317, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA5DEDIO6TTTYZXNIT7DJLRL32RVANCNFSM4IWWUSZA .

0reactions
samthorcommented, Apr 21, 2020

I bumped up package.json to 0.5.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extending an HTMLDialogElement - javascript - Stack Overflow
showModal () method throws a "does not exist" error. I'm obviously missing something here, what is it? HTML: <modal-dialog></modal-dialog>.
Read more >
HTMLDialogElement.showModal() - Web APIs - MDN Web Docs
Exceptions. InvalidStateError DOMException. Thrown if the dialog is already open (i.e. if the open attribute is already set ...
Read more >
Creating a Modal Dialog Web Component - Carl Rippon
We use window.customElements.define() to let the page know about our web component, passing in our chosen tag name and an ES6 class that...
Read more >
jshcrowthe/dialog-el - webcomponents.org
This repo is a Custom Element for creating accessible dialogs/modals It is heavily inspired by ... if called on an already open dialog,...
Read more >
For recursive components, make sure to provide the "name ...
But it throws error in the Console: “[Vue warn]: Unknown custom element: <select-option> - did you register the component correctly?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found