Chosen's library supports an option `max_shown_results` which limits the number of results shown. This is quite critical (IMO) for performance when there are a lot of options.

Comments

jerrylow created an issue. See original summary.

jerrylow’s picture

StatusFileSize
new2.01 KB

Adding patch for this.

nagy.balint’s picture

Status: Active » Needs work

Hi!

Thanks for the patch!

The schema and default value definitions are missing however from the patch. Look at the "config" folder of the module.

idebr’s picture

Assigned: jerrylow » Unassigned
Status: Needs work » Needs review
StatusFileSize
new4.82 KB
new3.37 KB
new6.05 KB

Attached patch implements the following changes:

  1. Added max_shown_results to the chosen.settings configuration schema
  2. Updated the Chosen configuration form with the description from the Chosen options page https://harvesthq.github.io/chosen/options.html
  3. Added a FunctionalJavascript test
idebr’s picture

Title: No settings for `max_shown_results` » Allow `max_shown_results` to be configured through the Chosen configuration form
idebr’s picture

StatusFileSize
new496 bytes
new3.37 KB
new6.05 KB

Fixed the FunctionalJavascript test namespace.

Status: Needs review » Needs work

The last submitted patch, 6: 3065967-6.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

nagy.balint’s picture

Seems the patch fails on the line

$this->cssSelect('.chosen-search-input')[0]->focus();

idebr’s picture

Yes, I forgot the Drupal testbot does not actually have to Chosen library so it's pretty moot to put in any kind of testing related the Chosen itself.

idebr’s picture

Status: Needs work » Needs review
StatusFileSize
new4.25 KB
new3.56 KB

Attached patch implements the following changes:

  1. Removed changes to the current tests.
  2. Added a default value for max_shown_results in the install config.

  • nagy.balint committed 34dcde3 on 8.x-2.x authored by idebr
    Issue #3065967 by idebr, jerrylow: Allow `max_shown_results` to be...
nagy.balint’s picture

Status: Needs review » Fixed

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.