palantir/blueprint

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

Open

#5,932 创建于 2023年2月9日

在 GitHub 查看
 (3 评论) (0 反应) (0 负责人)TypeScript (20,263 star) (2,167 fork)batch import
P3Package: coreType: bughelp wanted

描述

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.

贡献者指南