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

FormItem: Style is broken #274

Closed
gnseo opened this issue Jan 21, 2020 · 2 comments · Fixed by #275
Closed

FormItem: Style is broken #274

gnseo opened this issue Jan 21, 2020 · 2 comments · Fixed by #275

Comments

@gnseo
Copy link
Contributor

gnseo commented Jan 21, 2020

Describe the bug
In FormItem component, currentRange is always null.

To Reproduce
Steps to reproduce the behavior:
I've installed @ui5/webcomponents-react version v0.7.0.

If I add the following line into node_modules/@ui5/webcomponents-react/lib/FormItem.js under 50th line like below.

50 var currentRange = useContext(CurrentRange);
51 currentRange = useViewportRange("StdExt")

Then FormItem will be rendered as expected style.

@gnseo gnseo added the bug label Jan 21, 2020
@gnseo
Copy link
Contributor Author

gnseo commented Jan 21, 2020

Also I'd added an import line at the top of this file.

import { useViewportRange } from '@ui5/webcomponents-react-base/lib/useViewportRange';

MarcusNotheis added a commit that referenced this issue Jan 21, 2020
every form item had his own context as it was part of the bundled file. Now the Form shares a context with the FormItems.

Fixes #274
MarcusNotheis added a commit that referenced this issue Jan 21, 2020
every form item had his own context as it was part of the bundled file. Now the Form shares a context with the FormItems.

Fixes #274
@MarcusNotheis
Copy link
Contributor

Thanks for spotting this @iamuan!
I tried so solve it slightly differently as the root cause was a bundling issue (Context was not shared between Form and FormItem). Now, the form provided the viewport range and Item reads this value again.
We just published @ui5/webcomponents-react@0.7.1-dev.0, please reopen the issue in case it is not fixed.

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 a pull request may close this issue.

2 participants