cesarrew / ng2-currency-mask

A very simple currency mask directive that allows using a number attribute with the ngModel.
MIT License
235 stars 116 forks source link

Focus input with tab and prefix seted have diferent behavior #170

Open jhonattan471 opened 2 years ago

jhonattan471 commented 2 years ago

When I don't have a prefix, and focus the input with tab, all the value is selected.

I need this same behavior when prefix is seted.

Reading the files, and doing some debugging, i findout that on focus with tab this function is called by keyUp event :

fixCursorPosition(forceToEndPosition)

I need that when enter this function with tab, (forceToEndPosition === undefined), dont enter this condition

else if (currentCursorPosition < this.getRawValueWithoutPrefixStartPosition()) {
            this.inputManager.setCursorAt(this.getRawValueWithoutPrefixStartPosition());
}

How can I do that ? I never did a change to a lib before, Do you can make it or I need to copy this lib and use 'locally' ?