-
Notifications
You must be signed in to change notification settings - Fork 9
fix donutty.js #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix donutty.js #21
Conversation
Hi @TemporaryTetra I kind of get what the problem is, as
By your code, the ability to pass in a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make the change suggested and I can build and test
@@ -22,7 +22,7 @@ | |||
|
|||
this.$wrapper = doc.querySelectorAll( el )[0]; | |||
|
|||
} else if ( el instanceof window.HTMLElement ) { | |||
} else if ( doc.querySelector( `.${el.className}` ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to oth 8000 ers. Learn more.
this should be;
} else if ( el instanceof HTMLIFrameElement || el instanceof HTMLElement ) {
Thanks for the quick reply, I also tried HTMLIFrameElement but this check
doesn't see my wrapper class.
https://i.imgur.com/uHCSZ2n.png
пт, 15 січ. 2021 о 17:28 Simon Goellner <notifications@github.com> пише:
… ***@***.**** requested changes on this pull request.
Please make the change suggested and I can build and test
------------------------------
In src/donutty.js
<#21 (comment)>:
> @@ -22,7 +22,7 @@
this.$wrapper = doc.querySelectorAll( el )[0];
- } else if ( el instanceof window.HTMLElement ) {
+ } else if ( doc.querySelector( `.${el.className}` ) ) {
this should be;
} else if ( el instanceof HTMLIFrameElement || el instanceof HTMLElement ) {
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#21 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALEM52RD32G2EQOAYBTTENLS2BNJZANCNFSM4WDV4U6Q>
.
|
But the way it works on the front end is correct
https://i.imgur.com/uHCSZ2n.png
пт, 15 січ. 2021 о 21:26 Nikolai Nasibullin <zedoir1@gmail.com> пише:
… Thanks for the quick reply, I also tried HTMLIFrameElement but this check
doesn't see my wrapper class.
https://i.imgur.com/uHCSZ2n.png
пт, 15 січ. 2021 о 17:28 Simon Goellner ***@***.***> пише:
> ***@***.**** requested changes on this pull request.
>
> Please make the change suggested and I can build and test
> ------------------------------
>
> In src/donutty.js
> <#21 (comment)>:
>
> > @@ -22,7 +22,7 @@
>
> this.$wrapper = doc.querySelectorAll( el )[0];
>
> - } else if ( el instanceof window.HTMLElement ) {
> + } else if ( doc.querySelector( `.${el.className}` ) ) {
>
> this should be;
>
> } else if ( el instanceof HTMLIFrameElement || el instanceof HTMLElement ) {
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#21 (review)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ALEM52RD32G2EQOAYBTTENLS2BNJZANCNFSM4WDV4U6Q>
> .
>
|
Sorry, I totally don't understand what that means, are you able to show me a reduced test case in CodeSandbox or something? |
Check for
HTMLElement
does not work correctly ifel
is in an iframe. Since iframe creates a new space.Therefore, in this case, it will be better to check if
el
exists in the document.