-
Notifications
You must be signed in to change notification settings - Fork 40
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
Please make parent click handling optional. #47
Comments
Hello! Have you looked at the "Shared picker" example in the demo? https://codepen.io/Sphinxxxx/pen/zRmKBX If you still need more custom behavior, try attaching the picker to a common parent element and then hijack the const picker = new Picker({
parent: document.body,
...
});
picker.__originalOpenHandler = picker.openHandler;
picker.openHandler = function(e) {
if (shouldActuallyOpen) {
this.__originalOpenHandler();
}
}; Here is a working example of that last method: |
Thank you!
…On Wed, Jul 13, 2022 at 8:03 AM Andreas Borgen ***@***.***> wrote:
Hello! Have you looked at the "Shared picker" example in the demo?
https://codepen.io/Sphinxxxx/pen/zRmKBX
If you still need more custom behavior, try attaching the picker to a
common parent element and then hijack the openHandler() method to control
when the picker should open:
const picker = new Picker({
parent: document.body,
...});
picker.__originalOpenHandler = picker.openHandler;picker.openHandler = function(e) {
if (shouldActuallyOpen) {
this.__originalOpenHandler();
}};
Here is a working example of that last method:
https://jsfiddle.net/9g4nsdz3/2/
—
Reply to this email directly, view it on GitHub
<#47 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJTWEGDSA2HPPLIVAU257LVTZE2VANCNFSM53FYQVHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In use case of sharing one picker instance across multiple buttons the 'parent'/container element may be different from the button (body or section). Click on parent should not always open the picker. So please add option to ignore handling on parent click
The text was updated successfully, but these errors were encountered: