Skip to content

Improve width submenu in block menu #14163

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

Closed
TCOTC opened this issue Feb 20, 2025 · 14 comments
Closed

Improve width submenu in block menu #14163

TCOTC opened this issue Feb 20, 2025 · 14 comments
Assignees
Milestone

Comments

@TCOTC
Copy link
Contributor

TCOTC commented Feb 20, 2025

无论使用什么字体,输入框的宽度应该固定

使用不同的界面字体,输入框的宽度会不同(微软雅黑最短,霞鹭文楷中等,鸿蒙字体最长):

video.webm

不对齐就很难看:

Image

@Vanessa219 Vanessa219 added this to the 3.1.25 milestone Mar 7, 2025
Vanessa219 added a commit that referenced this issue Mar 7, 2025
@88250 88250 changed the title 无论使用什么字体,输入框的宽度应该固定 The width of the input box should be fixed regardless of the font used Mar 7, 2025
@TCOTC
Copy link
Contributor Author

TCOTC commented Mar 7, 2025

滚动条的宽度改成自适应了,但输入框的宽度还是会变

@Vanessa219
Copy link
Member

输入框是弹性布局,px 剩余的位置都是它的。

@TCOTC
Copy link
Contributor Author

TCOTC commented Mar 7, 2025

我感觉是输入框把菜单撑开的

video.webm

@Vanessa219
Copy link
Member

没有设置200px 呀

@TCOTC
Copy link
Contributor Author

TCOTC commented Mar 7, 2025

我的意思就是说这个输入框的宽度是字体决定的就很奇怪,微软雅黑时输入框宽度差不多是 200px,鸿蒙字体时就宽了一截。输入框的宽度固定一下比较舒服

@Vanessa219
Copy link
Member

这个是自适应的,后面字体宽他就窄。

@TCOTC
Copy link
Contributor Author

TCOTC commented Mar 8, 2025

那 issue 标题是不是得改改

@Vanessa219 Vanessa219 changed the title The width of the input box should be fixed regardless of the font used Improved width submenu in block menu Mar 8, 2025
@88250 88250 changed the title Improved width submenu in block menu Improve width submenu in block menu Mar 16, 2025
@TCOTC
Copy link
Contributor Author

TCOTC commented Apr 18, 2025

@Vanessa219 还是觉得输入框的宽度不固定(或者说是比预期更长)很奇怪,可能会影响各种地方的布局

比如我这里用鸿蒙字体之后数据库选项颜色菜单就会突出一部分:

Image

@Vanessa219
Copy link
Member

这个可以固定一下,其他可以拖拽的就固定不了。

@Vanessa219
Copy link
Member

我的用了鸿蒙也是正常的, @88250 你电脑上看看

Image

@Vanessa219
Copy link
Member

Windows 上确实有这个问题,但是是由于 input 上的 padding-right 造成的,很奇怪。没有找到解决方案。

@TCOTC
Copy link
Contributor Author

TCOTC commented Apr 20, 2025

我认为是跟 input 的 font-size 有关,有没有办法让 font-size 不影响宽度?

video.webm
video.webm

@Vanessa219
Copy link
Member

好像只能写死,但写死的话就没有办法自适应了

@TCOTC
Copy link
Contributor Author

TCOTC commented Apr 22, 2025

我试了一下,在这个菜单里,input 元素用 width: 0; flex: 1;,父元素用 display: flex; 貌似可以,或者给 input 元素加个属性 size="1" 也行

Vanessa219 added a commit that referenced this issue Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants