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

content is not applied to angular model when focussing textAngular via tab key #379

Closed
mjamin opened this issue Oct 30, 2014 · 9 comments
Closed

Comments

@mjamin
Copy link

mjamin commented Oct 30, 2014

http://plnkr.co/edit/2WAUpG2z3qG3a7fa3zxz?p=preview

  1. focus the first input
  2. focus textangular via tab
  3. enter text (-> angular model is not getting updated)

When focussing textAngular via mouseclick it works as expected.

@SimeonC
Copy link
Collaborator

SimeonC commented Oct 30, 2014

I fixed your plunkr, It's working for me in chrome http://plnkr.co/edit/kl8grT3hlxQsDatO9GmU?p=preview

What browser are you using?

@mjamin
Copy link
Author

mjamin commented Oct 31, 2014

Oh sorry, I'm using the latest Firefox (33.0.2). I can confirm that it works in Chrome, but still not in Firefox.

(As an aside: the original plunker worked to show the problem in FF, but Chrome has stricter mime type checking so hotlinking the textAngular files on github doesn't work there)

@SimeonC
Copy link
Collaborator

SimeonC commented Nov 4, 2014

OK, I've had a look. I've no idea on this one, turns out that tabbing into a content editable doesn't trigger any events, so focus, blur, keyup, keydown, none of them are triggering.

At this point I don't think I can do anything to fix this easily or sensibly.

@mjamin
Copy link
Author

mjamin commented Nov 4, 2014

Hmm.. if you initialize the model with some value (not empty string though) it works: http://plnkr.co/edit/3KeNcLacLr1w0zj83PJH?p=preview

Another observation: hitting enter while writing into textangular also triggers a model update

@mjamin
Copy link
Author

mjamin commented Nov 4, 2014

Also, the element gets the "focussed" CSS class, so the events do seem to work?

@mjamin
Copy link
Author

mjamin commented Nov 4, 2014

The problem seems to be when I focus via tab, the content doesnt get wrapped in p tags, but is instead inserted like this:

foo<p></p>

This causes _blankTest() to return true. This also explains why pressing enter fixes it (-> new paragraph).

@SimeonC
Copy link
Collaborator

SimeonC commented Nov 4, 2014

Hmmm, when I tried debugging it and just put a console.log out on the events none of them actually worked, though in my case I think it was putting the text in correctly. I think the events are triggering off something else as the focussed class is added by the text-angular directive while all model manipulation is done by the child ta-bind directive.

I can try have another look later on.

@mjamin
Copy link
Author

mjamin commented Dec 8, 2014

Any updates?

@mjamin
Copy link
Author

mjamin commented Jan 12, 2015

Looks like there is simply a call to setSelectionToElementStart(...) missing when focussing textAngular via TAB.

This needs to happen here as well, if event.keyCode == 9

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

No branches or pull requests

2 participants