text-mask / text-mask

Input mask for React, Angular, Ember, Vue, & plain JavaScript
https://text-mask.github.io/text-mask/
The Unlicense
8.26k stars 827 forks source link

react-text-mask - keepCharPositions behaviour #575

Open FacundoGFlores opened 7 years ago

FacundoGFlores commented 7 years ago

Based on the MaskedInput component provided for react, I've created the following one:

class Picker extends Component {
  constructor(props) {
    super(props);
    this.state = {
      customMask: this.props.withTime ? DATETIME_MASK : DATE_MASK,
    }
  }

  render() {
    const { customMask } = this.state;
    const { placeholder } = this.props;
    return (
      <MaskedInput
        className="custom-input"
        mask={customMask}
        guide={false}
        showMask={true}
        keepCharPositions={true}
      />
    )
  }
}

The thing is that I want to get the keepCharPositions behaviour, but when I have guide: false , the previous one does not work; instead, if I put guide: true then keepCharPositions: true works like a charm.

I am currently using: "react-text-mask": "^5.0.2".

OctopussyO commented 3 years ago

The thing is that I want to get the keepCharPositions behaviour, but when I have guide: false , the previous one does not work

I noticed the same problem on Vue =(

I am currently using: "vue-text-mask": "^6.1.2"