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 an option to hide the drop down arrow (or the complete drop down including arrow) for "no choice inputs" #1213

Open
marcopenhacking opened this issue Sep 27, 2024 · 0 comments

Comments

@marcopenhacking
Copy link

marcopenhacking commented Sep 27, 2024

Is your feature request related to a problem? Please describe.
I like to have an easy way using an option to hide the drop down arrow (marked yellow). This is to made a special input field with just one pre-defined data selection look the same like other input field with multiple choices on the same page.

image

Describe the solution you'd like
Add an option removeDropDownButton (for just arrow) or removeDropDown to remove the drop down completely with the arrow button

This removes the drop-down but not the drop down arrow:

        callbackOnCreateTemplates: function(template) {
            return {
              dropdown: (classNames, isSelectOne) => {
                return template(`
                  <div class="${classNames.listDropdown} choices__list--hidden"></div>
                `);
              }
            };
        }

...
document.addEventListener('DOMContentLoaded', (event) => {
    const dropdown = document.querySelector('.choices__list--hidden');
    if (dropdown) {
      dropdown.remove();
    }
  });
...

Describe alternatives you've considered
Suppress the button using CSS. My first attempts failed.

Additional context
Add any other context or screenshots about the feature request here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant