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

Range picker rendering in wrong position #6073

Closed
1 task done
lidppp opened this issue Nov 4, 2022 · 2 comments
Closed
1 task done

Range picker rendering in wrong position #6073

lidppp opened this issue Nov 4, 2022 · 2 comments
Labels

Comments

@lidppp
Copy link

lidppp commented Nov 4, 2022

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.2.13

Environment

vue@3.2.41, chrome@106.0.5249.119, macOS@12.5.1

Reproduction link

Edit on CodeSandbox

Steps to reproduce

When the width of the component is large enough, click the end time input box, and the pop-up window will be rendered in the wrong position

组件宽度足够大时, 点击结束时间输入框, 弹窗渲染位置错误

// file: components/vc-picker/RangePicker.tsx
// line: 984

// panelDivRef and arrowRef cannot get offsetWidth in the early stage of component rendering
// 组件渲染初期 panelDivRef和arrowRef 无法获取offsetWidth
...
        let arrowLeft = 0;
        let panelLeft = 0;
        if (
          mergedActivePickerIndex.value &&
          startInputDivRef.value &&
          separatorRef.value &&
          panelDivRef.value
        ) {
          // Arrow offset
          arrowLeft = startInputDivRef.value.offsetWidth + separatorRef.value.offsetWidth;
          if (
            panelDivRef.value.offsetWidth &&
            arrowRef.value.offsetWidth &&
            arrowLeft >
              panelDivRef.value.offsetWidth -
                arrowRef.value.offsetWidth -
                (direction === 'rtl' || arrowRef.value.offsetLeft > arrowLeft
                  ? 0
                  : arrowRef.value.offsetLeft)
          ) {
            panelLeft = arrowLeft;
          }
        }

...

What is expected?

The popup appears in the right place

弹窗出现在正确的位置上

What is actually happening?

wrong popup location

弹窗位置错误

QQ20221104-111139-HD.mp4
@lidppp
Copy link
Author

lidppp commented Nov 4, 2022

我创建了一个PR来修复此处问题 #6074

Copy link

github-actions bot commented Nov 8, 2023

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant