Skip to content

Menu does not adjust position automatically if it'll be hidden by a browser edge #1520

@praneetloke

Description

@praneetloke

TuSimple/naive-ui version (版本)

2.20.0

Vue version (Vue 版本)

3.2.20

Browser and its version (浏览器及其版本)

Chrome (latest)

System and its version (系统及其版本)

macOS 11.6

Node version (Node 版本)

Reappearance link (重现链接)

https://codesandbox.io/s/damp-dew-l98js

Reappearance steps (重现步骤)

Add a menu with a lengthy label.

(Hover over the "Test" menu item in the codesandbox reproduction URL.)

Expected results (期望的结果)

The submenu containing the lengthy label is automatically placed in a way that is not hidden by the edge.

Actual results (实际的结果)

Any component that renders as an overlay does not seem to account for the edge of the viewport, thus requiring manual placement. Sometimes manual placement is not possible as in the case of a menu with children that might have lengthy labels. You can either place all child items to the side or none at all.

Remarks (补充说明)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions