javascript - Is this feature or bug, for Setting focus to a textbox? -
this can seen on knockout.js site well.
when open page in ie11 or ff 38, , go example 2: click-to-edit , click on name - bert bertington, caret (cursor) of textbox @ start of text, while in chrome @ end.
if feature, suggest how keep caret in end when label changes textbox in ie11 , ff38.
i able fix in ff38 resetting contents of observable below, not work in ie11.
var str = self.msg(); self.msg(''); self.msg(str);
i using knockout-3.2.0 if matters.
update
the issue seems browsers rather knockout (sorry confusion).
i tried setting focus of text field using jquery , javascript .focus() functions , still getting same result on ie11 , firefox 38.
any appreciated.
you correct, issue of how different browsers handle focus event. workaround manually set cursor end of text within textbox.
an example of doing can found here. if want happen automatically using knockout, have create own custom binding based on hasfocus binding, or modify knockoutjs library directly. focus event triggered on line 3813 of knockout 3.2.0 non minified js file.
Comments
Post a Comment