Skip to content
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.

When a 'type=number' Control's value has its last decimal removed, cursor is placed at the beginning of input. #493

Closed
MixKCet opened this issue Oct 25, 2016 · 2 comments
Labels

Comments

@MixKCet
Copy link

MixKCet commented Oct 25, 2016

Hey!

Found this weird issue when creating an input with a float value. Created a gist here:
https://esnextb.in/?gist=87dc7cd3f897aeeed43b2c0f0d1435dd

Try backspacing from each of the fields to see the behaviour.

Cheers

@MixKCet MixKCet closed this as completed Oct 25, 2016
@MixKCet MixKCet changed the title When a 'type=number' When a 'type=number' Control's value has its last decimal removed, cursor is placed at the beginning of input. Oct 25, 2016
@MixKCet MixKCet reopened this Oct 25, 2016
@davidkpiano
Copy link
Owner

@MixKCet Seems similar to these issues:

facebook/react#7781
facebook/react#7253
facebook/react#7359

So this is unrelated to RRF, but a current issue with React itself.

Here's a simple workaround:

        <Control.text
          model='.floaty'
          type='number'
          step='.1'
          value={undefined}
        />

The above makes the control uncontrolled, so it can't be remotely updated, but it also avoids the React issues.

@MixKCet
Copy link
Author

MixKCet commented Nov 8, 2016

Huh, look at that. Thanks @davidkpiano!

@MixKCet MixKCet closed this as completed Nov 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants