Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

Korean text gets cut off #181

Closed
jinarusha opened this issue Jul 4, 2014 · 12 comments
Closed

Korean text gets cut off #181

jinarusha opened this issue Jul 4, 2014 · 12 comments

Comments

@jinarusha
Copy link

While entering "가나다", the first letter ("가") is almost invisible until I press enter.

@mbenford
Copy link
Owner

I did a quick test here with that text (가나다) and every character was displayed correctly. Could you provide a Plunker script showing the problem?

@jinarusha
Copy link
Author

You actually have to type the letters out instead of copy & pasting to see the problem.

Here's the script. It's identical to your demo but just in case..

When I copy & past "가나다", it works fine. But when I actually type it into the box, the first letter gets cut off (I'm using a Mac). The first letter is not completely invisible but only a small portion of it is visible.

I asked my friend to test it out on a Windows PC. Stragnely this time, no matter how long the text was, the last letter was invisible while he was typing.

Of course, when enter was pressed, a perfectly good tag gets created.

I don't know if this is a thing that happens only with Korean text.

@mbenford
Copy link
Owner

Are you using some custom CSS for the input element?

@jinarusha
Copy link
Author

No, the Plunker script has no css in it. And I also just noticed that Korean text with 2 characters length, such as "가나" doesn't get recognised as valid tag. I don't know if other Asian texts have the same problem.

Here's a video of me entering some Korean texts on Plunker: link.

@deflexor
Copy link

Hi, i have similar trouble with typing russsian letter 'б', typing it triggerss special comma callback because it's code 188 is part of unicode sequence, so i added option add-on-comma="false" and now have no trouble except that can not add tags on typing comma.

@mbenford
Copy link
Owner

There's an underlying feature that automatically re-sizes the input width as you type so all characters are visible at the same time. All I can imagine is that feature is somehow miscalculating the correct width when certain characters are typed into the input. I'll try to emulate a Korean keyboard in order to reproduce this problem.

About the other issue, by default a tag must contain 3 characters in order to be deemed valid. You can change that by setting the min-length option to a value that better fits your needs.

@jinarusha
Copy link
Author

Awesome. Thank you

@mbenford
Copy link
Owner

@deflexor That issue has been reported before. It should be addressed by #95.

@mbenford
Copy link
Owner

@jinarusha I've managed to emulate a Korean keyboard and succeeded in reproducing your problem. I'm converting this issue into a bug and I'll try to fix it for the next release.

If you don't mind, I'd like to ping you when this is fixed so you can test it and confirm it's working.

@mbenford mbenford added this to the 2.1.0 milestone Jul 13, 2014
@jinarusha
Copy link
Author

Great! Looking forward to the fix. Please ping me when it's available. Thank you for your awesome work.

@mbenford
Copy link
Owner

@jinarusha I've added a new method to the tagsInputConfig service that allows the threshold used to calculate the input width to be changed. Set the threshold to 15 (pixels) and every typed Korean character should be all visible.

You can grab the latest build here and use the following code to test it out:

app.config(function(tagsInputConfigProvider) {
    tagsInputConfigProvider.setTextAutosizeThreshold(15);
});

Let me know if that solves your problem.

@jinarusha
Copy link
Author

@mbenford I couldn't access the files in the link you provided. So I used Grunt to build it and tried it. The fix works perfectly and it seems the problem is now fixed! I'm a newbie to angular and it's unfortunate that I was not able to contribute. Thank you for your awesome work!

Bessonov pushed a commit to Bessonov/ngTagsInput.ie8 that referenced this issue May 3, 2015
Add a new method to the tagsInputConfig service to allow the threshold
used by the tagsInput directive to re-size the input element based on its
content to be configured.

Closes mbenford#181
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants