insin / inputmask-core

Standalone input mask implementation, independent of any GUI
MIT License
304 stars 52 forks source link

Change setSelection to set cursor to the end of the previous value block #19

Closed NickGard closed 8 years ago

NickGard commented 8 years ago

OR to the beginning of the pattern

Examples

1) Given a pattern of '----- [[11 1111 ]]-' and a value of '23 45' (the input shows '----- [[23 45 ]]-') a) a selection anywhere after '5' will set the cursor immediately after the '5' b) a selection between '3' and '4' will set the cursor immediately after the '3' c) a selection anywhere before '2' will set the cursor immediately before the '2' d) a selection between '2' and '3' will not change

2) Given a pattern of '----- [[11 1111 ]]-' and no value (the input shows '----- [[ __ ]]-') a) a selection anywhere will set the cursor to the beginning of the pattern