🐛 corrige la page blanche lors de l'écriture de nombre avec virgule dans artiste auteur
parent
c96e8bcbf2
commit
8d8121844c
|
@ -145,4 +145,29 @@ describe('CurrencyInput', () => {
|
|||
wrapper.setProps({ value: '1000000' })
|
||||
expect(Number(getInlineWidth().replace(/em$/, ''))).to.be.greaterThan(5)
|
||||
})
|
||||
|
||||
it('should not call onChange if the value is not a correct number', () => {
|
||||
let onChange = spy()
|
||||
mount(<CurrencyInput onChange={onChange} />)
|
||||
.find('input')
|
||||
.simulate('change', {
|
||||
target: { value: '-', focus: () => {} }
|
||||
})
|
||||
mount(<CurrencyInput onChange={onChange} />)
|
||||
.find('input')
|
||||
.simulate('change', {
|
||||
target: { value: '.', focus: () => {} }
|
||||
})
|
||||
mount(<CurrencyInput onChange={onChange} />)
|
||||
.find('input')
|
||||
.simulate('change', {
|
||||
target: { value: '.5', focus: () => {} }
|
||||
})
|
||||
mount(<CurrencyInput onChange={onChange} />)
|
||||
.find('input')
|
||||
.simulate('change', {
|
||||
target: { value: '8.', focus: () => {} }
|
||||
})
|
||||
expect(onChange).not.to.have.been.called
|
||||
})
|
||||
})
|
||||
|
|
|
@ -49,7 +49,7 @@ export default function CurrencyInput({
|
|||
// Only trigger the `onChange` event if the value has changed -- and not
|
||||
// only its formating, we don't want to call it when a dot is added in `12.`
|
||||
// for instance
|
||||
if (!nextValue.current) {
|
||||
if (!nextValue.current || nextValue.current.match(/(\.$)|(^\.)|(-$)/)) {
|
||||
return
|
||||
}
|
||||
event.persist()
|
||||
|
|
|
@ -1042,11 +1042,11 @@ contrat salarié . activité partielle . heures chômées:
|
|||
titre.fr: heures chômées
|
||||
contrat salarié . activité partielle . heures travaillées:
|
||||
contrôles.0.en: >-
|
||||
[automatic] In the case of part-time work, the working time must be less
|
||||
than that stipulated in the employment contract.
|
||||
[automatic] In the context of the partial activity, the working time must be
|
||||
less than that stipulated in the employment contract.
|
||||
contrôles.0.fr: >-
|
||||
Dans le cadre du temps partiel, le temps de travail doit être inférieur à
|
||||
celui inscrit dans le contrat de travail.
|
||||
Dans le cadre de l'activité partielle, le temps de travail doit être
|
||||
inférieur à celui inscrit dans le contrat de travail.
|
||||
description.en: >-
|
||||
[automatic] In the case of short-time working, the number of hours remaining
|
||||
worked. Must be less than the contractual time.
|
||||
|
|
Loading…
Reference in New Issue