Skip to content

Does not update when input element is hidden on first renderΒ #178

@phiresky

Description

@phiresky

When the input element is hidden on first render (e.g. a parent element has display: none set), then the computed size of the sizer element is "auto" instead of "123px", and the input does not notice when it gets shown, it is only updated after it is rerendered

Somewhat hacky, but this can be fixed by adding a resize observer watching the size of the input

	if (this.input.current)
		new ResizeObserver(() => this.updateInputWidth()).observe(
			this.input.current,
		)

to the componentDidMount function

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions