Double-click on text selection in input fields in Chrome

I have an HTML input box with digital text that has points ie "1.00.1". If I double-clicked this field in IE or firefox, the browser will select only part of the text (between the dots), but in the double-click on Chrome, select all the text in this field. What is the best way to change this behavior in Chrome? If there is only text in the input fields (i.e. Test.test), double-clicking with a selection in Chrome works the same as IE and Firefox. enter image description here

+4
source share
1 answer

, . ( dblclick), dblclick ( ): ( ) , dblclick, , (reset pos 0). , : http://jsfiddle.net/n2rzyxvg/3/

jQuery(document).on('click',"#input",function(){
    var clickpos = jQuery(this).getCursorPosition() ;
    jQuery(this).data('clickpos',clickpos) ;
    console.log("Click ! " + clickpos) ;
});

jQuery(document).on('dblclick',"#input",function(){
    console.log("DblClick ! " + jQuery(this).data('clickpos')) ;
});

, perfert ( dblclick, - dblclick): Jquery dblclick, , , jQuery / : jQuery

, - dblclick, .

,

+1

All Articles