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-number] theme 设置为 column 时 autoWidth 无效 #1720

Closed
sagittarius-rev opened this issue Nov 1, 2022 · 4 comments
Closed

[input-number] theme 设置为 column 时 autoWidth 无效 #1720

sagittarius-rev opened this issue Nov 1, 2022 · 4 comments
Labels
to be published fixed, not be published

Comments

@sagittarius-rev
Copy link

tdesign-vue 版本

tdesign-vue 0.49.2

重现链接

https://codesandbox.io/s/tdesign-vue-demo-forked-4u7r9t?file=/src/demo.vue

重现步骤

使用 InputNumber 组件,将 theme 属性的值设为 "column" ,即增减按钮出现在输入框右侧。

同时设置 autoWidth 属性为 true ,希望输入时能自动调整组件宽度。

期望结果

进行数值输入时,输入框自动调整组件宽度。

实际结果

theme 值为 "column" 时, autoWidth 参数无效,输入时输入框宽度不会变化,超出部分会被截断。

框架版本

Vue(2.6.14)

浏览器版本

Chrome(104.0.5112.102)

系统版本

Windows 10

Node版本

14.15.1

补充说明

theme 值为 "normal""row" 时, autoWidth 属性表现正常。

vue-next 版本也有相同问题。

react 版本会出另外一个问题,单独提交 issue 。

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2022

👋 @sagittarius-rev,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@yaogengzhu
Copy link
Contributor

https://github.com/Tencent/tdesign-common/blob/87d99048b78174699548bec58dca5c920464300c/style/web/components/input-number/_index.less#L61

这里的auto 被覆盖了!可以尝试在

&.@{prefix}-is-controls-right {
  min-width: 88px;
  width: auto;
}

避免!important

我尝试修改下

@chaishi
Copy link
Collaborator

chaishi commented Nov 7, 2022

resolved in Tencent/tdesign-common#969

@uyarn
Copy link
Collaborator

uyarn commented Nov 9, 2022

fixed in 0.49.4

@uyarn uyarn closed this as completed Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to be published fixed, not be published
Projects
None yet
Development

No branches or pull requests

4 participants