renato-bohler / redux-form-input-masks

Input masking with redux-form made easy
https://bohler.dev/redux-form-input-masks/
MIT License
138 stars 10 forks source link

Selecting an entire value and hitting delete should delete the selected value #43

Closed scottmcpherson closed 6 years ago

scottmcpherson commented 6 years ago

What are you reporting?

Currently, the only way to delete the entire value is by hitting delete once for each digit. It would be a better UX to be able to select the entire value and delete it by hitting delete once.

raisal - broker 2018-06-21 14-51-51
renato-bohler commented 6 years ago

I totally agree. I'll give it a try in the next few weeks.

scottmcpherson commented 6 years ago

Let me know if I can help! Happy to submit a PR

renato-bohler commented 6 years ago

Sure! It shouldn't be too hard to solve. If you want to submit a PR I'll be happy to review it.

scottmcpherson commented 6 years ago

@renato-bohler I was able to resolve this but wanted to check with you before modifying the test to get them to pass.

To get this to work, part of what I did was removed this block: https://github.com/renato-bohler/redux-form-input-masks/blob/master/src/createNumberMask.js#L60-L66

What is the purpose of this block? With it removed, it still prevents the modification of suffixes and prefixes.

renato-bohler commented 6 years ago

Yes, tests will have to be updated.

I would have to check, but I suspect that without this block, messing only with the prefix and suffix would clear the input, and in this case the input field should just not be updated.

renato-bohler commented 6 years ago

:tada: This issue has been resolved in version 1.1.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket: