palantir/blueprint

Input Group component input width doesn't get update when toggle with display:nonee

Open

#5932 opened on Feb 9, 2023

View on GitHub
 (3 comments) (0 reactions) (0 assignees)TypeScript (20,263 stars) (2,167 forks)batch import
P3Package: coreType: bughelp wanted

Description

Environment

  • Package version(s): 4.15.1
  • Operating System: mac os M1
  • Browser name and version: chrome 110.0.5481.77

Code Sandbox

https://codesandbox.io/s/loving-feistel-zs09t4?file=/src/index.tsx

Steps to reproduce

<input type="text" placeholder="Search" class="bp4-input" style="padding-left: 0px; padding-right: 0px;">

Actual behavior

When the expanded input bar is display, the padding-left and padding-right don't get update to the actual icon width. Instead, stay as 0. Search bar position looks broken.

Expected behavior

When the expanded input bar is display, padding-left and padding-right should get re-calculated and set to the actual icon width.

Possible solution

https://github.com/palantir/blueprint/blob/develop/packages/core/src/components/forms/inputGroup.tsx#L250 updateInputWidth should get triggered once visibility change.

Contributor guide