javascript - How to click on a input field and fire event in knockoutjs and test it? -
What I am trying to achieve is that when the user clicks on the input field, Want to turn on the page? I am using And I think this code is using DOM manipulation which is hard to test without using My thoughts ... Hope that helps. haphocus but this works only for the first time when I click on the search bar and then the event is not called.
& lt; Div class = ".home-search-panel" & gt; & Lt; Input type = "search" data-bind = "hasFocus: searchInputFocus ()" name = "q" placeholder = "@. Search placeholder copy" value = "@ request .QueryString [" q "]" maxlength = "150" Class = "input-product-search" autocomplete = "off" /> & Lt; / Div & gt; ) .offset () top. };
jquery-jasmine .
data-bind = "event: {onfocus: searchInputFocus}" In this case, SearchInputFocus The function is called when the focus on the input box is
Comments
Post a Comment