select2 / select2

Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.
https://select2.org/
MIT License
25.88k stars 6.26k forks source link

Bugfix / Support data-placeholder values which consist solely of digits #6297

Open billynoah opened 8 months ago

billynoah commented 8 months ago

This pull request includes a

The following changes were made

Validate placeholder type as an object instead of checking if it is a string. This fixes a bug where placeholder is defined as an inline attribute data-placeholder which consists solely of digits. In this case the value type becomes a number which breaks the test typeof placeholder === 'string' and causes the placeholder to get ignored.