element-plus [Component] [scrollbar] horizontal scroll bar does not show up after expand el-menu

jqjz2hbq  于 5个月前  发布在  其他
关注(0)|答案(2)|浏览(55)

Bug Type: Component

Environment

  • Vue Version: 3.4.33
  • Element Plus Version: 2.7.7
  • Browser / OS: Chrome 126.0.6478.183 / Windows 11
  • Build Tool: Vite

Reproduction

  • el-scrollbar

Element Plus Playground

Steps to reproduce

  1. expand "Navigator One"
  2. expand "item five"
  3. scroll down

What is Expected?

horizontal scroll bar show up

What is actually happening?

horizontal scroll bar did not show up

Additional comments

This is an intermittent issue, but in most cases, the bug can be reproduced. I'v tried 15 times in Element Plus Playground, only in my last attempt did the scroll bar show up correctly.

hc2pp10m

hc2pp10m1#

It seems to be due to the fact that the width of ElMenu is always 300px.

2nbm6dog

2nbm6dog2#

It seems to be due to the fact that the width of ElMenu is always 300px.

我觉得是scrollbar没有取到正确的scrollwidth,所以算出的结果不符合显示的条件;因为,如果你将窗口缩放一下,触发了resize,就可以正确计算了;
似乎是内部的transition组件是直接修改原生dom的,没有走到vue的更新(你可以看一下我pr的方法和示例)

相关问题