Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ffe-form-react): Add support for forwarding refs #440

Merged
merged 2 commits into from
Oct 4, 2018

Conversation

selbekk
Copy link
Contributor

@selbekk selbekk commented Oct 2, 2018

BREAKING CHANGE: Requires react@^16.3

This commit adds support for forwarding refs to the Input and
TextArea components, so consumers can handle focus programmatically.


Since this is a bump in peer dependencies, this is per definition a breaking change - but it's a small and simple one to deal with for most consumers.

Fixes #231

@selbekk
Copy link
Contributor Author

selbekk commented Oct 2, 2018

Hm, looks like some of the tests break (but only when running jest in ci-mode). I'm gonna look into it. :)

@selbekk
Copy link
Contributor Author

selbekk commented Oct 2, 2018

Related to this: jestjs/jest#5441

@ivarni
Copy link
Contributor

ivarni commented Oct 2, 2018

Could you perhaps add some documentation and an example?

@selbekk
Copy link
Contributor Author

selbekk commented Oct 2, 2018

Could you perhaps add some documentation and an example?

In my mind, this is something that should "just work" out of the box - but I don't mind adding an example

@ivarni
Copy link
Contributor

ivarni commented Oct 2, 2018

Well, yeah, but since we're not doing this for all our components it might be worth pointing out to someone that isn't familiar with the codebase that we're doing it for this one?

Kristofer Selbekk added 2 commits October 2, 2018 12:59
BREAKING CHANGE: Requires react@^16.3

This commit adds support for forwarding refs to the `Input` and
`TextArea` components, so consumers can handle focus programmatically.
@selbekk selbekk force-pushed the 231-use-forwardRef-take-two branch from 43ad6fc to 998af6c Compare October 2, 2018 11:08
@selbekk
Copy link
Contributor Author

selbekk commented Oct 2, 2018

There - similar examples for both textarea and input components are added - and I think I fixed the tests as well. #famouslastwords

@@ -6,7 +6,7 @@ Vi har tre varianter av inputfelt:
2. inline
3. text-like

_Standard_ og _inline_ er mest relevant for utviklere. De ser helt like ut, men opprører seg annerledes i samspillet
_Standard_ og _inline_ er mest relevant for utviklere. De ser helt like ut, men oppfører seg annerledes i samspillet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep funny spelling error or we riot!

@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 80.592% when pulling 998af6c on 231-use-forwardRef-take-two into bb71ad2 on develop.

@selbekk
Copy link
Contributor Author

selbekk commented Oct 3, 2018

Do you want to merge this at some point @antidecaf or @kwltrs ? Since it's a breaking change (at least on paper), I'd like an OK from at least one of you.

Copy link
Contributor

@antidecaf antidecaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@selbekk selbekk merged commit 784fa13 into develop Oct 4, 2018
@selbekk selbekk deleted the 231-use-forwardRef-take-two branch October 4, 2018 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants