question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

maskedValue not applied to initialValue

See original GitHub issue

Description:

maskedValue is not being applied to a field’s initialValue. It only works when editing the field from its initial state

import { Form, Text } from 'informed';
const format = value => (value != null ? `$${value}` : value)
const parse = value => (value != null ? value.replace('$', '') : value)
return (
<Form>
  <Text field="name" format={format} initialValue="test" parse={parse} />
</Form>

Observed behaviour: The mask is not applied to the initial form value, which shows as test. Typing in the field after the initial load correctly applies the mask.

Expected behaviour: The initial form value should have mask applied and show as $test.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
joepuzzocommented, May 30, 2019

Working on it!

0reactions
mrfeltoncommented, Jun 2, 2019

Did you forget to release 2.7.8 with the fix for this @joepuzzo ? i see the version number was bumped but there is no new release tag on github or release on npmjs

Read more comments on GitHub >

github_iconTop Results From Across the Web

jquery mask masked doesnt work. How set initial value to mask
masked() - Gets a masked value programmatically. You can set the value by $('#id').val(initialValue).mask(maskPattern, options);.
Read more >
masked input with initial value on ngOnInit not working on ivy
I updated to Angular 9 and ngx-mask 9. There's an issue with masked inputs, when value is set OnInit it's not displaying the...
Read more >
Input Mask Guide | imaskjs
For untyped masks typedValue and unmaskedValue works identically. Mask also can be used without UI, e.g.
Read more >
jquery.inputmask - UNPKG
The mask is defined and will not change during the input. ... this option to true the plugin also expects the initial value...
Read more >
cpr-mask - npm
There are no other projects in the npm registry using cpr-mask. ... the non-masked value to see if the invalidClass should be applied...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found