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

Add customOpener configuration option and handle clicks #4

Merged
merged 5 commits into from
Nov 17, 2023

Conversation

kkarpieszuk
Copy link
Contributor

@kkarpieszuk kkarpieszuk commented Oct 19, 2023

Fixes #3

Test steps:

  • add select element which you want multiselect to be applied for
  • add some <button id="foo">
  • initialize multiselect with option customOpener: '#foo'
  • click the button and make sure multiselect is open

You can see this in real use on this branch of WPForms:
https://github.com/awesomemotive/wpforms-plugin/pull/8341/commits/12d59d1b75ea3717ae43784bfd913f9df7282016

  • go to WPForms > Entries > Select some form with entries
  • on the entries list page click gear icon in right top corner of the table

vokoscreenNG-2023-10-19_12-49-10

Copy link
Member

@mahdiyazdani mahdiyazdani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution here. Please see my comments below:

Based on the options property name, which suggests “customOpener”, I would recommend passing a single DOM element to the opener argument. This approach would eliminate the need to loop through multiple opener elements, as it is uncommon to have more than one opener for a single dropdown menu.

Additionally, please see the following non-blocker issues as well:

  • It seems you didn’t build and compile the final package for distributed files. See the repository readme file in creating dist files.
  • No demo is added to the demo website.
  • No documentation is added to the “Settings” table on the demo website.

@kkarpieszuk
Copy link
Contributor Author

Thank you @mahdiyazdani for the review. I applied all your suggested changes, including the update od the demo. Please review again

Copy link
Member

@mahdiyazdani mahdiyazdani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @kkarpieszuk 🙌

Copy link
Member

@mahdiyazdani mahdiyazdani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @kkarpieszuk 🙌

@mahdiyazdani mahdiyazdani assigned cheh and unassigned mahdiyazdani Nov 17, 2023
@mahdiyazdani mahdiyazdani merged commit 427b1b6 into master Nov 17, 2023
3 checks passed
@mahdiyazdani mahdiyazdani deleted the 3-custom-opener branch November 17, 2023 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow opening menu from custom selector
3 participants