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

Input are not properly sized in some scenarios #40

Closed
marcoancona opened this issue Oct 29, 2018 · 7 comments
Closed

Input are not properly sized in some scenarios #40

marcoancona opened this issue Oct 29, 2018 · 7 comments
Assignees
Labels
bug Something isn't working stale

Comments

@marcoancona
Copy link

I am experience a problem when the component is loaded with a provided value. Only the first digit of day, month, year, as well as time, is displayed (see image).
screenshot 2018-10-29 at 17 34 58

The input fields are then correctly resized either by changing the value prop, or by clicking on one of the fields.

@marcoancona marcoancona changed the title Problem rendering the first value Problem rendering value for the first time Oct 29, 2018
@wojtekmaj
Copy link
Owner

Hmm, it looks like auto-expanding fields are not working correctly 🤔 Are you using default styling or you have decided to write your own ones?

@wojtekmaj wojtekmaj self-assigned this Nov 8, 2018
@wojtekmaj wojtekmaj added the question Further information is requested label Nov 8, 2018
@marcoancona
Copy link
Author

marcoancona commented Nov 8, 2018

I am using the default style (to be precise I load the .nostyle but the default CSS style is already loaded separately at that time).
I am using this within a (https://v0.material-ui.com/#/components/popover)[Material-UI Popover]. Might this be the case? I don't see this problem in the example associated with the project.
Also trying to debug this, I found that getBoundingClientRect().width in updateInputWidth() returns 0. I wonder if this method is called too early in the rendering pipeline.

@marcoancona
Copy link
Author

Ok, I realized that if I use the <Popover animated={false}> the problem does not occur. My guess is that the first updateInputWidth() is called while the Popover component is transitioning (a scale transformation, I guess) and the span used as a reference has a width of zero.

I guess this is quite an edge case, so I can also find my own workaround if you are not interested in supporting this scenario.

@wojtekmaj
Copy link
Owner

I'm actually interested as this affects some other more common scenarios, like rendering input before a font is loaded. I just need a better solution than just measuring everything every .1 seconds :/

@wojtekmaj wojtekmaj changed the title Problem rendering value for the first time Input are not properly sized in some scenarios Nov 12, 2018
@wojtekmaj wojtekmaj added bug Something isn't working and removed question Further information is requested labels Nov 12, 2018
@Phamiliarize
Copy link

Phamiliarize commented Nov 20, 2018

This is also occurs when date picker/datetime picker etc are put into a bootstrap collapse (specifically using reactstrap)

There is a fatal error causing pages to crash when the picker is clicked:
Uncaught TypeError: Cannot read property 'clientHeight' of null

I think it perhaps is related to the difficulty with sizing?

@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days.

@github-actions github-actions bot added the stale label Feb 13, 2023
@github-actions
Copy link
Contributor

This issue was closed because it has been stalled for 14 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

3 participants