Skip to content

Fix selectize maxOptions limit for large option lists#348

Merged
superdav42 merged 1 commit intomainfrom
fix/selectize-max-options
Feb 28, 2026
Merged

Fix selectize maxOptions limit for large option lists#348
superdav42 merged 1 commit intomainfrom
fix/selectize-max-options

Conversation

@superdav42
Copy link
Collaborator

@superdav42 superdav42 commented Feb 28, 2026

Summary

  • The selectize library defaults to maxOptions: 1000, which silently hides options beyond that limit in dropdowns
  • This causes the Domain Seller addon's TLD selector to stop at ~.space alphabetically after syncing 1500+ TLDs from a provider
  • The fix counts actual <option> elements in each [data-selectize] select and raises maxOptions when needed

Test plan

  • Sync TLDs from a domain provider (OpenSRS/Namecheap) to get 1500+ TLDs
  • Open Domain Seller settings → Default Search TLDs dropdown — verify all TLDs are visible past .space
  • Edit a domain product → Supported TLDs dropdown — verify all TLDs are visible
  • Verify other selectize dropdowns (e.g. currency, country) still work normally

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Improvements
    • Enhanced dropdown component performance when handling large option lists (1000+ items).
    • Improved initialization sequence for better reliability and reactivity.
    • Added support for dynamic template rendering and option loading for dropdowns.

When a select2 field has more than 1000 options (e.g. synced TLD lists),
selectize's default maxOptions:1000 silently hides entries past ~.space
alphabetically. Now counts actual options and raises the limit accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 28, 2026

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

📥 Commits

Reviewing files that changed from the base of the PR and between 9d2003e and 7857ddc.

⛔ Files ignored due to path filters (1)
  • assets/js/selectizer.min.js is excluded by !**/*.min.js
📒 Files selected for processing (1)
  • assets/js/selectizer.js
 _____________________________
< ░R░e░v░i░e░w░ ░i░n░ ░b░i░o░ >
 -----------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

✏️ Tip: You can disable in-progress messages and the fortune message in your review settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/selectize-max-options

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

@superdav42 superdav42 merged commit 849871a into main Feb 28, 2026
7 of 9 checks passed
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.

1 participant