1
0
mirror of synced 2024-11-25 06:16:08 +03:00
Commit Graph

512 Commits

Author SHA1 Message Date
Gaël Poupard
7ca986701a Improving .select2-hidden-accessible
To match last standards, see [CSS hide and seek](http://hugogiraudel.com/2016/10/13/css-hide-and-seek/) for more explanations :)

Also I removed the negative margin because of unwanted effects in some case, as seen on Bootstrap.
2017-10-26 13:24:48 -04:00
Michal Kleiner
01d881c8ae Move role and aria-readonly attributes from render function to bind function 2017-10-26 13:21:57 -04:00
Michal Kleiner
e1cda22475 Add role and aria-readonly attributes to single selection dropdown selected value 2017-10-26 13:21:57 -04:00
nobodyman
8398788069 perform deep merge for Defaults.set() 2017-10-26 13:17:26 -04:00
Tim Kang
6ff10680a6 Use attr instead of prop for select2-selection__rendered title (#4640)
See #3895, and jQuery docs on `attr`:

> As of jQuery 1.6, the .prop() method provides a way to explicitly retrieve property values, while .attr() retrieves attributes.
2017-10-26 13:06:23 -04:00
Michael Mackus
cd08d805a4 Check for string value 2017-10-26 00:36:45 -04:00
MichaelMackus
c56c20cff0 Fix AJAX data source error
Fixes #4355

Verified in Firefox & Chromium
2017-10-26 00:36:31 -04:00
Krzysztof Śmiałek
04d3a5da66 Add dedicated event for clearing
Closes #4929, #5045.
2017-10-26 00:30:31 -04:00
Krzysztof Śmiałek
10bda78b37 Fix value not being cleared when unselect event is emitted
Fixes #5049.
2017-10-26 00:30:24 -04:00
alexweissman
18929d6e5a Add ; before beginning of factory wrapper (#5089)
Adding ending statement at the start of the code as absence of that causes console error while concatenating files.
2017-10-25 23:17:05 -04:00
shivamgupta001
1cf42cf6a8 on clear cleared tooltip too when placeholder present 2017-10-25 23:12:35 -04:00
shivamgupta001
e2c654b0ec on clear cleared tooltip too when placeholder present 2017-10-25 23:12:20 -04:00
alexweissman
ef2ef8b685 Fix keyboard not closing when closing dropdown on iOS 10 (#4680) 2017-10-25 22:45:29 -04:00
alexweissman
7d41ea153e Merge branch 'hotfix' into develop and bump for 4.0.6-rc.0 2017-10-25 18:37:05 -04:00
alexweissman
633e707424 Merge branch 'patch-1' of https://github.com/frkami123/select2 into hotfix 2017-10-25 18:04:57 -04:00
alexweissman
2a21adeb2e Merge branch 'patch-2' of https://github.com/ettiennelouw/select2 into hotfix 2017-10-25 17:59:11 -04:00
alexweissman
a3952c7302 Replace autocapitalize=off with autocapitalize=none (#4994) 2017-10-25 17:52:35 -04:00
alexweissman
65f85c3109 Merge branch 'master' of https://github.com/mnrafg/select2 into hotfix 2017-10-25 17:46:47 -04:00
alexweissman
58d9836b7d minor formatting fixes for #5093 2017-10-25 16:55:40 -04:00
Julian Yuste
b11d6e20b0 Fix for issue #4632 2017-10-25 18:25:50 +02:00
Kou Tsuneka
7c13ecc795 remove a unnecessary quote marks 2017-09-27 03:29:16 +07:00
alexweissman
c1e62b7db7 Czech: Add missing commas and periods (#5052) 2017-09-25 20:35:37 -04:00
alexweissman
0cc279ac75 Merge #4817 2017-09-25 20:33:40 -04:00
Ettienne Louw
671a87c764 Fixed Syntax Error
Based this on on ca.js file
2017-09-25 20:28:57 +02:00
Ivan Kvasnica
398870d982 Add missing commas and periods 2017-09-25 10:30:23 +02:00
alexweissman
3561810a64 Fix line lengths to keep Travis happy 2017-09-24 21:43:57 -04:00
alexweissman
ed24c34028 Fixes French translation (see #4988) 2017-09-24 21:38:04 -04:00
alexweissman
389aa1ab97 Add Bosnian (bs) 2017-09-24 16:42:12 -04:00
alexweissman
1afea17194 Fixed Norwegian inputTooShort message (#4896) 2017-09-24 16:28:47 -04:00
alexweissman
bdc70c80a0 Updated sk.js localisation (#4915) 2017-09-24 16:27:10 -04:00
alexweissman
9f55c376d2 Merge branch 'master' of https://github.com/milupo/select2 into hotfix 2017-09-24 16:23:30 -04:00
alexweissman
22e73a5586 Fix typo in Romanian
Merged from @peterlupu
2017-09-24 16:19:47 -04:00
alexweissman
4930f735fa Merge branch 'patch-1' of https://github.com/nelson6e65/select2 into nelson6e65-patch-1 2017-09-24 16:08:01 -04:00
alexweissman
ca4de9dcb0 Merge branch 'focus-event' of https://github.com/nino-s/select2 into hotfix 2017-09-06 16:59:54 -04:00
Nelson Martell
5f7feeb801 Update es.js
Update the 'errorLoading' message.
2017-09-06 13:41:31 -04:00
Muhammad Nasir Rahimi
1b2d0424e9 Translation improved 2017-06-18 10:50:10 +04:30
Muhammad Nasir Rahimi
dbb1132b7e JSHint maxlen fix 2017-06-17 13:44:22 +04:30
Muhammad Nasir Rahimi
5330a0cc62 Add Pashto (ps) Language 2017-06-17 13:29:44 +04:30
milupo
575e862f98 Create hsb.js 2017-06-11 20:02:09 +02:00
milupo
d914a6d5f5 Create dsb.js 2017-06-11 20:00:58 +02:00
milupo
5a7f832f12 Create dsb.js 2017-06-10 17:03:53 +02:00
milupo
3bc4522200 Create hsb.js 2017-06-10 17:03:05 +02:00
milupo
25fdc6bef4 Delete hsb.js 2017-06-10 17:02:15 +02:00
milupo
53c4c97411 Delete dsb.js 2017-06-10 17:01:36 +02:00
milupo
32ba6d7573 Create dsb.js 2017-06-10 16:04:48 +02:00
milupo
a4a095bda8 Create hsb.js 2017-06-10 16:02:59 +02:00
depesr
5bb7446d24 Update sk.js 2017-05-23 07:22:18 +02:00
depesr
e43a1f2165 Updated sk.js localisation 2017-05-23 07:18:15 +02:00
Frederic G. Østby
f38d84df71 Fixed norwegian inputTooShort message. 2017-05-05 13:02:43 +02:00
Ettienne Louw
2b3dd18d35 Create af.js
Added afrikaans language file
2017-03-29 18:07:49 +02:00
Børge Antonsen
946149277e Simplified Norwegian(nb) translation to a more correct text 2017-03-02 10:13:57 +01:00
Josef Šimánek
cd7d4be576 correct typo in pt.js 2016-12-30 18:22:49 +01:00
Kevin Brown
751b36767f Corrected linting issue in Turkish translation 2016-12-30 12:15:56 -05:00
mhamlet
f6fa52dcc0 Added Armenian Localization
This closes https://github.com/select2/select2/pull/3993.
2016-12-30 12:15:25 -05:00
osman orhan
fd4a082531 Add missing errorLoading to Turkish translation
This closes https://github.com/select2/select2/pull/4650.
2016-12-30 11:50:58 -05:00
Kevin Brown
3b8a5d3660 Merge pull request #4730 from quantus/master
Add missing finnish translations
2016-12-30 11:44:28 -05:00
Derrick Hammer
45a8773454 Fix UMD commonjs support
This is based on the UMDJS jQuery template available at
95563fd6b4/templates/jqueryPlugin.js

This closes https://github.com/select2/select2/issues/4557.
This closes https://github.com/select2/select2/pull/4558.
2016-12-29 19:40:09 -05:00
Mike Dearman
16b4840c0e Support selecting options with falsy values
Previously you could not select an option which had the number 0
as its value, because there was a check which would detect it as
an option without a value. There was a similar issue with selecting
options which had a blank string as the value.

This closes https://github.com/select2/select2/issues/4604.
This closes https://github.com/select2/select2/issues/4516.
This closes https://github.com/select2/select2/issues/3252.
This closes https://github.com/select2/select2/issues/3519.

This closes https://github.com/select2/select2/pull/4605.
This closes https://github.com/select2/select2/pull/4517.
2016-12-29 19:23:48 -05:00
Nimit Suwannagate
625fc78ee6 Add errorLoading translation of Thai language.
This closes https://github.com/select2/select2/pull/4521.
2016-12-29 19:01:37 -05:00
Leandro Regueiro
f3788e2cda Simplify Danish and Arabic translations
This closes https://github.com/select2/select2/pull/4547.
2016-12-29 18:59:44 -05:00
Leandro Regueiro
8fcc6202c3 Update Galician translation 2016-12-29 18:59:15 -05:00
mitja-p
8e6422c570 Add Slovene translation
This closes https://github.com/select2/select2/pull/4576.
2016-12-29 18:55:49 -05:00
niki7har
4df965219e Update de.js
The german errorLoading message was missing.

This closes https://github.com/select2/select2/pull/4711.
This closes https://github.com/select2/select2/pull/4591.
2016-12-29 18:48:18 -05:00
Sági György
7d1d133523 i18n hu.js update. Added errorLoading property.
This closes https://github.com/select2/select2/pull/4724.
2016-12-29 18:46:29 -05:00
Yaron Uliel
cb9a904578 Make tags matching case insensitive
This closes https://github.com/select2/select2/issues/3566
This closes https://github.com/select2/select2/pull/4509
2016-12-29 18:26:19 -05:00
Pekka Pöyry
124087ae2a Add missing finnish translations 2016-12-22 15:03:12 +02:00
Nino Schoch
294e7e664d Fixed form focus lost 2016-06-16 13:45:21 +02:00
Harry
7eab29e271 Added Greek (el) translation
Translated English (en) language file to Greek (el).

This closes https://github.com/select2/select2/pull/4139
This closes https://github.com/select2/select2/pull/4146
2016-05-26 20:36:22 -04:00
Kevin Brown
ea79a197e0 Select2 now detects added and removed options
Select2 will now automatically update the selection if there are options
added to or removed from the DOM within the `<select>` element. This is
supported in all browsers except for Internet Explorer 8. Internet
Explorer 8 does not support the DOM mutation events which were added in
Internet Explorer 9, and it does not support mutation observers which
are the recommended way of handling this in modern browsers.

DOM mutation events also trigger for the `<select>` itself when it is
pulled from the DOM, so we need to filter these out within the event
handler.

Despite supporting mutation observers, we cannot accurately detect if
the removed option was selected at one time or another, so we need to
always re-pull the selection when an element is deleted.

This closes https://github.com/select2/select2/issues/4248
This builds upon https://github.com/select2/select2/pull/4249
2016-05-23 23:31:17 -04:00
Kevin Brown
4b9e02f022 Corrected check for opening the dropdown
This corrects the check that was used when the dropdown was opened, so
the results would be immediately rendered instead of delaying the
loading. Previously it would delay the immediate load but immediately
load the results when the search term was emptied.

This closes https://github.com/select2/select2/issues/4191
This closes https://github.com/select2/select2/pull/4192
This closes https://github.com/select2/select2/pull/4202
2016-05-14 22:26:56 -04:00
Kevin Brown
481c43883e selectOnClose now properly works with closeOnSelect
Previously we hacked around the infinite loop between closeOnSelect and
selectOnClose by attempting to detect what event was being triggered
without knowing what event triggered it. Now we properly relay the
Select2 event and the jQuery event that triggered the select or unselect

This closes https://github.com/select2/select2/issues/4012
2016-05-14 22:14:20 -04:00
Kevin Brown
ad8447cc35 Add a new _type parameter for the first event argument
This will include the event type in the _type property, so it can be
accessed within the event handlers if it's not normally passed in. This
should not conflict with any existing handlers, and this should not be
considered a public property on event arguments.
2016-05-14 22:01:42 -04:00
Kevin Brown
9f581285d8 Renamed focusFirstItem method
This renames the `focusFirstItem` method to `highlightFirstItem`, which
better reflects what is actually happening. This also ensures that the
highlight is visible when it is moved by calling
`ensureHighlightVisible`.

This closes https://github.com/select2/select2/issues/3479
This closes https://github.com/select2/select2/pull/4238
2016-05-14 21:05:14 -04:00
Alexander Leonov
e897d008a6 Fixed infinite scrolling issue using down key. 2016-05-14 21:04:31 -04:00
Nadim Afana
fba261c670 Fixed EOL to Unix format. 2016-05-06 14:54:13 -07:00
Nadim Afana
16e26310e1 Fixed more indentation issues. 2016-05-06 12:28:49 -07:00
Nadim Afana
6e9657105b Fixed indentation. 2016-05-06 12:23:58 -07:00
Nadim Afana
a1dc7f23d1 Fixed unit tests and updated source code to handle HTML5 attribs. 2016-05-05 21:41:20 -07:00
Nadim Afana
95b1f8b409 Reverted a line in base.js regarding tab index. 2016-05-05 18:38:38 -07:00
Nadim Afana
76298267f9 Updated inputData.js 2016-05-05 18:12:51 -07:00
Nadim Afana
54e126a664 Fixed bug #4014 2016-05-05 15:38:31 -07:00
Damien Finck
b1ea28bb7d Add missing French translation 2016-05-04 19:55:01 +02:00
Maarten Brouwers
89dcfef94b linting fix for lt i18n file 2016-05-03 00:08:06 +02:00
Aurelijus Rožėnas
5b5eddd183 Fixed broken lithuanian translation
This closes https://github.com/select2/select2/issues/4301.

Signed-off-by: Kevin Brown <kevin@kevin-brown.com>
2016-04-23 22:33:22 -04:00
Kevin Brown
31e7a1d4c5 Support the focus event on the <select> element
This adds basic support for focusing the Select2 element by triggering
the `focus` event on the underlying <select> element.  This implicitly
adds support for <label> elements, which will trigger the `focus` event
on the `<select>` if it is clicked.

This also fixes the focus issue that previously existed if Select2 was
opened while in a <label>. The focus would be transferred to the search
dropdown, and then immediately pulled away to the <select> element. This
happened because the <label> element triggers the `focus` event when a
`click` event propagates its way up, and we do not stop the propagation
of the `click` event when it is triggered on the selection.

This closes https://github.com/select2/select2/issues/2311.
This closes https://github.com/select2/select2/issues/4203.
This closes https://github.com/select2/select2/pull/4235.
2016-04-23 19:58:04 -04:00
Ryan Cousart
ecdc416635 Fixing bug with non-static parents for dropdowns
The offset of the parent was only being subtracted if the dropdown was
facing down, this now subtracts it if the dropdown is facing up as well.
This more or less applies the same fix as
e260860789,
but when calculating the position of the dropdown when it is facing up.

This closes https://github.com/select2/select2/issues/3303
This closes https://github.com/select2/select2/pull/4267
2016-04-17 16:58:01 -04:00
Kevin Brown
c099755012 Merge pull request #4246 from somethvictory/master
add Khmer translation
2016-04-14 17:54:48 -04:00
Kevin Brown
3b8cd2e369 Create an option when tokenizing if needed
Previously the tokenizer only worked when creating multiple options
at once if all of the options existed. It always worked when creating
a single option, because all of the special cases were handled by the
tagging module. When working with multiple options, the tagging
module does not kick in until after the query has been run, which
is when the tokenizer does its magic.

This fixes the issue by automatically creating the option tags that
the tagging module would normally create. It only does this if the
options do not already exist, so we don't need to worry about the
tokenizer creating duplicates of existing options.

This closes https://github.com/select2/select2/issues/3458
2016-03-27 18:29:01 -04:00
Kevin Brown
cfb66f5e4f Attempt to detect aborted requests
The error handler should not be raised if a request is aborted while
another one is sent out. This attempts to detect those cases by
handling the case where the error was raised and the request has a
status code of 0, which should either mean we're in offline mode or
the request was aborted.

This closes https://github.com/select2/select2/issues/4205
2016-03-27 15:44:40 -04:00
Kevin Brown
fe26b083eb Fix dropdownAutoWidth so it actually works
Previously the `dropdownAutoWidth` option didn't work because the
dropdown was being absolutely positioned, so setting the width to
`auto` didn't actually have an effect. This cannot be solved by
just setting the width on the container, because that is also
absolutely positioned.

This closes https://github.com/select2/select2/issues/3101
2016-03-27 15:24:37 -04:00
Kevin Brown
c2c1aeef31 Fix calling select2('', args) on multiple elements
This fixes an issue that has existed since Select2 4.0.1 where the
arguments passed into each `<select>` were mutated. This no longer
mutates the arguments for each element, and instead only drops the
first argument once.

This closes https://github.com/select2/select2/issues/4245
2016-03-27 14:59:44 -04:00
jpic
8869b170b1 Set list-style further down the DOM
This closes https://github.com/select2/select2/issues/4225
This closes https://github.com/select2/select2/pull/4226
2016-03-27 14:55:21 -04:00
Sondre Eikanger Kvalø
0212edda95 Added missing Norwegian bokmaal label used for errors 2016-03-16 15:51:39 +01:00
Someth Victory
a7738c4517 fix jshint: Line is too long 2016-03-10 16:45:27 +07:00
Someth Victory
a797833e10 add Khmer translation 2016-03-10 16:35:09 +07:00
Radu Ungureanu
72d905f9e0 Romanian localization
- updated transaltions
- added translation for errorLoading
- issue fixes - compare characters length instead of message when adding terminal character

This closes https://github.com/select2/select2/pull/4208
2016-03-08 19:54:01 -05:00
Vasyl Zuzyak
e3f9466d8b Reuse result of previous calcualtion
This closes https://github.com/select2/select2/pull/4155.
2016-02-14 14:03:49 -05:00
Bruno Sampaio
983cd8e765 Recursively apply defaults
This closes https://github.com/select2/select2/pull/4130.
2016-02-14 13:58:14 -05:00
Ben
65179f16de Santize automatically generated ids
This closes https://github.com/select2/select2/issues/3618.
This closes https://github.com/select2/select2/pull/4123.
2016-02-14 13:48:19 -05:00
Kevin Brown
69ef214c92 Display error message on AJAX errors
This display the `errorLoading` translation when there is an error
during the AJAX cycle. Previously we were just throwing these errors
out, now we are actually displaying an error message.

This closes https://github.com/select2/select2/issues/3501
2016-01-04 20:07:37 -05:00