How can I manage focus states on an Angular 2 custom input component? -
i cannot find way manage through angular 2 how custom input gets focus label
(and for
attribute) , how manage states.
i'm trying give same focus-and-blur behaviour regular has. ideas on that?
thanks!
html have tabindex attribute, makes element focusable. http://w3c.github.io/html/editing.html#the-tabindex-attribute
then in component can listen focus event:
@hostbinding('tabindex') tabindex = -1; @hostlistener('focus') focushandler() { alert('focused!'); }
Comments
Post a Comment