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

MinWidth is set to 1 even placeholder is passed down #157

Open
thomaslc66 opened this issue May 16, 2019 · 0 comments
Open

MinWidth is set to 1 even placeholder is passed down #157

thomaslc66 opened this issue May 16, 2019 · 0 comments

Comments

@thomaslc66
Copy link

I encountered some issue with the placeholder size and the minWidth.

Some of my input have on render, a minWidth={1}, causing inputWidth also been equal to 1.
I have i icon in the same component to copy what's inside the input, and when i pass on this icon it trigger a re-render and then the inputWidth pass to 41, displaying all the content.

If i wan't something correct i have to set my Autosize component with minWidth like this:

        <AutosizeInput
          className={touched && error ? 'list_input_error' : 'list_input'}
          disabled={status}
          onClick={onClick}
          value={text}
          name={name}
          onChange={onChange}
          minWidth={text ? text.length * 8 : placeholder.length * 8}
          placeholder={placeholder}
        />

For context purpose and if you want to reproduce.
I use the @bluprintjs/core Tabs element with two tabs.
And this behaviour only happend on the AutosizeInput that are on the second tabs.

But the real question is WHY?

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

No branches or pull requests

1 participant