Skip to content
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

Firefox crashes when tagging with non-ASCII characters (Chinese/Japanese, diacritics, unicode, etc) #4743

Closed
4 of 11 tasks
vitorlee opened this issue Jan 10, 2017 · 11 comments
Closed
4 of 11 tasks

Comments

@vitorlee
Copy link

vitorlee commented Jan 10, 2017

Steps to reproduce the issue

  1. ONLY in Firefox browsers, no matter which version, which OS
  2. Enable tagging
  3. Switch IME to Chinese/Japanese model, and try to input some tags
  4. Never get the correct result

Environment

Browsers

  • Google Chrome
  • Mozilla Firefox
  • Internet Explorer

Operating System

  • Windows
  • Mac OS X
  • Linux
  • Mobile

Isolating the problem

  • This bug happens on the examples page
  • The bug happens consistently across all tested browsers
  • This bug happens when using Select2 without other pluigns
  • I can reproduce this bug in a jsbin
@gejobj
Copy link

gejobj commented Jan 24, 2017

I can reproduce this error writing á or é or â in firefox 50.1.0 when tagging is activated.
I try to create tags like: camión or melón at example page and it crash on firefox.
Copy and paste words have same error.

Regards.

@gejobj
Copy link

gejobj commented Jan 25, 2017

Please @vitorlee, change issue title because Spanish, French, German... all languajes that use words with accents cannot work under firefox. It seems firefox send accent before character and it makes break javascript.

@Feuda
Copy link

Feuda commented Jun 13, 2017

Same issue with firefox on linux, any solutions?

@alexweissman alexweissman changed the title Tagging doesn't support input Chinese/Japanese characters in Firefox Firefox crashes when tagging with non-ASCII characters (Chinese/Japanese, diacritics, unicode, etc) Sep 13, 2017
@kzkn
Copy link

kzkn commented Nov 2, 2017

Here is a small reproducing code (without select2).

<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
  </head>
  <body>
    <ul>
      <li class="input"><input type="text"></li>
    </ul>

    <script src="https://code.jquery.com/jquery-3.2.1.js" integrity="sha256-DZAnKJ/6XZ9si04Hgrsxu/8s717jcIzLy3oi35EouyE=" crossorigin="anonymous"></script>
    <script>
     var items = [];
     var $ul = $("ul");
     var $liin = $("li.input");
     var $in = $liin.find("input");
     $ul.on("input", "li.input", function() {
       items.push($in.val());
       $ul.empty();
       for (var e of items)
         $ul.append($("<li class='choice'>" + e + "</li>"));
       $ul.append($liin);
       $in.focus();
     });
    </script>
  </body>
</html>

Firefox will confuse when the <input> disappears from DOM tree while inputing with IME.

Select2 is being affected by this behaviour. At here:

this.$selection.find('.select2-selection__rendered').empty();

and here:

this.$selection.find('.select2-selection__rendered')
.append(this.$searchContainer);

@kzkn
Copy link

kzkn commented Jan 31, 2018

Same issue with Chrome (64.0.3282.119) on linux.

@kzkn kzkn mentioned this issue Jan 31, 2018
3 tasks
@kzkn
Copy link

kzkn commented May 20, 2018

In develop branch, bca6a50 is blocking the resolution of this issue.

@untidy-hair
Copy link

untidy-hair commented Dec 1, 2018

Hi, this is an issue for Chrome 70.0.3538 on MacOS X Sierra as well.
on https://select2.org/tagging

image

@rafadepaula
Copy link

Any solution to this? I'm having the same issue on any browser at Mac OS High Sierra.

@stale
Copy link

stale bot commented Mar 13, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status: stale label Mar 13, 2019
@stale stale bot closed this as completed Mar 20, 2019
@dgilperez
Copy link

Any solution or workaround? We just got hit buy this as well on MacOS.

@TeoMastro
Copy link

I have an issue with greek characters where:
Greek punctuation tone is inserted as separate character on select2 when using tagging and Multiple on same field. This happens only after the first letter. The first letter accepts the tone, if necessary, but after that tone is inserted as new character. Like this:

Actual greek word: Βοήθεια
How is inserted: Βο΄ηθεια

On first letter: Έλεγχος (Correctly inserted)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants