fix(editable_champ): can enter negative decimal number
This commit is contained in:
parent
c53b0a1c9e
commit
ff700b19bb
2 changed files with 6 additions and 1 deletions
|
@ -54,6 +54,6 @@ export class FormatController extends ApplicationController {
|
|||
const decimalSeparator =
|
||||
value.lastIndexOf(',') > value.lastIndexOf('.') ? ',' : '.';
|
||||
|
||||
return value.replace(new RegExp(`[^\\d${decimalSeparator}]`, 'g'), '');
|
||||
return value.replace(new RegExp(`[^-?\\d${decimalSeparator}]`, 'g'), '');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -199,6 +199,11 @@ describe 'The user' do
|
|||
wait_until {
|
||||
champ_value_for('nombre décimal') == '1234.56'
|
||||
}
|
||||
|
||||
fill_in('nombre décimal', with: '-1,234.56')
|
||||
wait_until {
|
||||
champ_value_for('nombre décimal') == '-1234.56'
|
||||
}
|
||||
end
|
||||
|
||||
scenario 'extends dossier experation date more than one time, ', js: true, retry: 3 do
|
||||
|
|
Loading…
Reference in a new issue