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

placeholder issue in Firefox #444

Closed
snekbaev opened this issue Dec 8, 2014 · 10 comments
Closed

placeholder issue in Firefox #444

snekbaev opened this issue Dec 8, 2014 · 10 comments
Labels

Comments

@snekbaev
Copy link

snekbaev commented Dec 8, 2014

Hi,

apparently previous placeholder issue strikes back in Firefox :) I noticed it a couple of weeks ago, didn't get a chance to create a plunkr and report, but now it's time.

Basically, when I use placeholder in FF it behaves weird. Here is the plunkr - http://plnkr.co/edit/ocVjGP4CqWtGuhMinJxv?p=preview

  1. when you open it you will see that input has the model value, but textangular doesn't. If you click inside textangular to focus it and click away - model value is lost (input will be empty too) and it becomes invalid.

  2. if you type something in textangular then input's content will be updated, but not vice versa

  3. that one is trickier: if you have some content in textangular, then delete it, click away, then enter something into it - it will remain red (invalid) and model will not be updated (input's content will remain empty) - you may need to do this several times to catch it

  4. if you will catch the 3) keep it "invalid" and try typing something FAST after it gets several characters it will freeze and by freeze I mean FF will freeze - "Application is not responding", so the only fix is via Task Manager :)))

  5. on initial plunkr load when input has the model value, but textangular doesn't - type pokemon in textangular, now if you press Space or Enter - it will become invalid

This may not be related, but when I tried to quickly debug it I saw that problem around 3) and similar issues is caused by the content being inserted into the root: textangular wraps everything I type into a single p tag, so when I delete everything and start typing then new text ends up next to that p tag, not in it.

Thank you!

P.S.: used FF 33.1.1 and textangular pre-14
P.S.S.: at least in the actual project where I have these problems when content is loaded I do see the initial model value in textangular, but in plunkr I don't, that's weird :) I will recheck as soon as aforementioned issues are addressed :)

@SimeonC
Copy link
Collaborator

SimeonC commented Dec 9, 2014

Thanks, I'll have a look when I can.

@SimeonC SimeonC added the bug label Dec 11, 2014
@SimeonC
Copy link
Collaborator

SimeonC commented Dec 15, 2014

OK, I think 1 is plunkr specific. It complains about something being insecure, outside of plunkr I don't get that issue or the error. I think 2 is also plunkr specific issue as I can replicate in plunkr, but not outside.

3 Is to do with placeholders in FF, for some reason it's not sending triggering focus events onwards if you click on the actual placeholder. I managed to crash FF with 4, but I think fixing 3 should fix this too.

The last point about the p tags, makes me want to re-write the whole content-editable using keydown events... But I don't actually want to, possibly I need to re-evaluate my default wrap just for better cross browser support.

@snekbaev
Copy link
Author

Thank you for investigating this. Yeah, I totally understand that rewrite is painful and time consuming :) However, of course you know the current issues better, maybe it is worth considering to take a shot now? Actually last week IE11 running in IE10 was failing too, I could click into the editor, but couldn't edit anything and developer's console showed, afaik, dom related error (about index something). I need to find a way how to replicate it again :)

@SimeonC
Copy link
Collaborator

SimeonC commented Dec 15, 2014

OK, I think I've got this figured out.

It seems if you click on the placeholder it puts the cursor before the first p tag. Hence the content is being typed into a bad place. Currently the _blankTest doesn't pick this up!! (Bad in and of itself) I think this may also be the cause of the index errors in IE as historically typing outside of the p tags caused issues - the reason for the default tag and associated stuffs.

I'll get back to you when I (think I) have a fix.

@snekbaev
Copy link
Author

Thank you!
Yeah, I was debugging it, as I mentioned earlier, and I saw that content was being inserted in a wrong place, if I just had more time, probably would have quick fixed it. Please also replace all foreach loops with regular for loops :) Otherwise I have to patch every time I update. Thanks again!

@SimeonC
Copy link
Collaborator

SimeonC commented Dec 15, 2014

Huh, I thought I'd done that already... Maybe I can get jshint to throw an error if they exist.

@snekbaev
Copy link
Author

Don't worry, I will recheck on the next -pre version :)
Thanks!

@SimeonC
Copy link
Collaborator

SimeonC commented Dec 15, 2014

Do you mean all the angular.forEach loops or the for(var i in array) loops?

@snekbaev
Copy link
Author

for(var i in array)

@SimeonC
Copy link
Collaborator

SimeonC commented Dec 15, 2014

Thanks, that has been taken out, definitely in the next pre-release.

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

No branches or pull requests

2 participants