Skip to content
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

[FEAT] Use instanceOf check for parent element (in settings) #193

Closed
tobium opened this issue Oct 10, 2022 · 2 comments
Closed

[FEAT] Use instanceOf check for parent element (in settings) #193

tobium opened this issue Oct 10, 2022 · 2 comments
Assignees
Labels
feature New feature or request

Comments

@tobium
Copy link

tobium commented Oct 10, 2022

Currently we only can specify the parentElement by a text css selector. It would be good to set the parentElement as HTMLElement instance too.

To allow this, we have to changed the following code in cupertino-pane.ts

from
if (this.settings.parentElement) {
this.settings.parentElement = document.querySelector(
this.settings.parentElement
);
} else {
this.settings.parentElement = this.el.parentElement;
}

to
if (this.settings.parentElement && !this.settings.parentElement instanceOf HTMLElement) {
this.settings.parentElement = document.querySelector(
this.settings.parentElement
);
} else {
this.settings.parentElement = this.el.parentElement;
}

@roman-rr roman-rr self-assigned this Oct 10, 2022
@roman-rr
Copy link
Collaborator

Hello @tobium
Thank you for proposal.
Could you please create pull request with this simple changes ?

@roman-rr
Copy link
Collaborator

@tobium let me know if you need this as soon as possible. Otherwise better new pull request, so you will be in contributors also.

@roman-rr roman-rr added the feature New feature or request label Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants