Skip to content

several fix and enhancements #1906

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

Merged
merged 18 commits into from
Nov 14, 2022
Merged

several fix and enhancements #1906

merged 18 commits into from
Nov 14, 2022

Conversation

fabienwnklr
Copy link
Contributor

@fabienwnklr fabienwnklr commented Nov 9, 2022

  • fix: style dropdown bootstrap4/5 : add !important for apply style when position is top with plugin auto_position
  • fix: appareance with input-group class : border radius was incorrect if input into an input-group bootstrap
  • feat: add ignoreOnDropdownHeight property : add property for ignore more selector for calculate height
  • fix: calcul dropdownheight with optgroup : height was wrong when select has an optgroup
  • fix: add separator height to dropdown height calcul : height was wrong when select has an optgroup
  • feat: add option 'search': for having a single select appareance without search mode using input
  • test: add test for normalize/search options : add test
  • fix: persitant state style for selected item : keep style on selected option when we hover other option

Note: sorry for the many commits I use two computers so sometimes I get lost...

@@ -158,6 +158,12 @@ $.extend(Selectize.prototype, {
$control_input.attr('placeholder', settings.placeholder);
}

// to have an identical rendering to a simple select (usefull for mobile device and do not open keyboard)
if (!self.settings.search) {
$control_input.attr('readonly', true);

Choose a reason for hiding this comment

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

There is a problem with ReadOnly.

If the person clicks on the input and types something on the physical keyboard the input will remain empty, but selectize will filter the items and will work anyway.

To fix this just listen to the focus event and when the input receives focus you apply a blur. That way the input will never be focused and the person will never be able to type anything and we won't have any problems.

Choose a reason for hiding this comment

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

A suggestion also to prevent the keyboard on mobile devices is to use $control_input.attr("inputmode", "none");

Some mobile browsers ignore the read_only property and show the keyboard anyway. But they respect input_mode.

The ideal is to have the 2 codes, read_only and input_mode none.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thank you so much for your feedback, I fixed that !

@risadams risadams merged commit f5d714a into selectize:master Nov 14, 2022
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.

3 participants