Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(ZIndex): 弹窗内vxe-table内组件的层级问题修复#7029

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
jyqwq wants to merge5 commits intovbenjs:main
base:main
Choose a base branch
Loading
fromjyqwq:feature/弹窗内vxe-table内组件的层级问题修复

The head ref may contain hidden characters:"feature/\u5F39\u7A97\u5185vxe-table\u5185\u7EC4\u4EF6\u7684\u5C42\u7EA7\u95EE\u9898\u4FEE\u590D"

Dismiss

Conversation

@jyqwq
Copy link
Contributor

@jyqwqjyqwq commentedDec 17, 2025
edited by coderabbitaibot
Loading

Description

默认的modal层级比vxe-table的组件层级高,会有如下问题
image
调整默认层级可以省去每次设置modal层级
image

Type of change

Please delete options that are not relevant.

  • [ ✅ ] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Please, don't make changes topnpm-lock.yaml unless you introduce a new test example.

Checklist

ℹ️ Check all checkboxes - this will indicate that you have done everything in accordance with the rules inCONTRIBUTING.

  • [ ✅ ] If you introduce new functionality, document it. You can run documentation withpnpm run docs:dev command.
  • [ ✅ ] Run the tests withpnpm test.
  • [ ✅ ] Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages withfeat:,fix:,perf:,docs:, orchore:.
  • [ ✅ ] My code follows the style guidelines of this project
  • [ ✅ ] I have performed a self-review of my own code
  • [ ✅ ] I have commented my code, particularly in hard-to-understand areas
  • [ ✅ ] I have made corresponding changes to the documentation
  • [ ✅ ] My changes generate no new warnings
  • [ ✅ ] I have added tests that prove my fix is effective or that my feature works
  • [ ✅ ] New and existing unit tests pass locally with my changes
  • [ ✅ ] Any dependent changes have been merged and published in downstream modules

Summary by CodeRabbit

  • Styling
    • Added z-index fixes for tooltip wrappers and select panels to ensure correct layering inside modals and dialogs.
  • Chores
    • Loaded the new style module at app bootstrap so these styling fixes are applied globally on startup.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-botbot commentedDec 17, 2025
edited
Loading

⚠️ No Changeset found

Latest commit:6d746ba

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go.If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitaibot commentedDec 17, 2025
edited
Loading

Walkthrough

Adds a new VXE CSS module that raises z-index for VXE tooltip wrappers and select panels, exports it from the styles package, and imports it into two bootstrap entry points to load the styles globally.

Changes

Cohort / File(s)Summary
VXE Styles Export
packages/styles/package.json
Added./vxe export entry pointing to./src/vxe/index.css.
VXE CSS Styles
packages/styles/src/vxe/index.css
New CSS rules:.vxe-tooltip--wrapper { z-index: 2001 !important; },.vxe-select--panel { z-index: 2001 !important; }.
Bootstrap Imports
Apps
apps/web-antd/src/bootstrap.ts,playground/src/bootstrap.ts
Addedimport '@vben/styles/vxe' to load the new styles at bootstrap.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verifyexports entry path and package resolution.
  • Check CSS specificity and potential side effects inside modals.
  • Confirm import order in bootstrap files relative to other global styles.

Suggested labels

bug

Suggested reviewers

  • anncwb
  • jinmao88
  • vince292007

Poem

🐰 I hopped through styles with a goal so small,

Lifted tooltips where modals call,
Two rules, one export, added with care,
Now panels perch without despair,
A tiny tweak — peace in the UI hall. 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check nameStatusExplanation
Title check✅ PassedThe title accurately describes the main change: fixing z-index layering issues for vxe-table components inside modals, which directly corresponds to the CSS modifications and style imports in the changeset.
Description check✅ PassedThe description includes problem context with screenshots, specifies it as a bug fix, and shows completion of all checklist items. However, it lacks detailed technical explanation of the solution and doesn't explicitly link to the issue number in the description text.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between1345fd7 and6d746ba.

📒 Files selected for processing (1)
  • packages/styles/src/vxe/index.css (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/styles/src/vxe/index.css
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Lint (windows-latest)
  • GitHub Check: Check (windows-latest)
  • GitHub Check: Test (windows-latest)
  • GitHub Check: Check (ubuntu-latest)
  • GitHub Check: Lint (ubuntu-latest)
  • GitHub Check: post-update (ubuntu-latest)
  • GitHub Check: post-update (windows-latest)

Thanks for usingCodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment@coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitaicoderabbitaibot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/styles/src/vxe/index.css (1)

3-9:Consider scoping the rules to modal contexts.

The current selectors apply globally to all.vxe-tooltip--wrapper and.vxe-select--panel elements. For better precision and to avoid potential side effects, consider scoping these rules to modal/dialog contexts:

-/** 弹窗内表格tooltip层级问题修复 */-.vxe-tooltip--wrapper {-  z-index: 2001 !important;-}-/** 弹窗内表格组件层级问题修复 */-.vxe-select--panel {-  z-index: 2001 !important;-}+/** 弹窗内表格tooltip层级问题修复 */+.ant-modal .vxe-tooltip--wrapper,+.vben-modal .vxe-tooltip--wrapper {+  z-index: 2001 !important;+}+/** 弹窗内表格组件层级问题修复 */+.ant-modal .vxe-select--panel,+.vben-modal .vxe-select--panel {+  z-index: 2001 !important;+}

This approach ensures the fix only applies within modal contexts where the issue occurs.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between1479f15 and581b488.

📒 Files selected for processing (4)
  • apps/web-antd/src/bootstrap.ts (1 hunks)
  • packages/styles/package.json (1 hunks)
  • packages/styles/src/vxe/index.css (1 hunks)
  • playground/src/bootstrap.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: mynetfanRepo: vbenjs/vue-vben-admin PR: 5397File: playground/src/bootstrap.ts:23-30Timestamp: 2025-01-15T04:29:13.944ZLearning: In the Vue-Vben-Admin project, commented code in bootstrap.ts showing modal and drawer configuration examples should be preserved as reference documentation, even after moving to CSS variables for z-index management.
📚 Learning: 2025-01-15T04:29:13.944Z
Learnt from: mynetfanRepo: vbenjs/vue-vben-admin PR: 5397File: playground/src/bootstrap.ts:23-30Timestamp: 2025-01-15T04:29:13.944ZLearning: In the Vue-Vben-Admin project, commented code in bootstrap.ts showing modal and drawer configuration examples should be preserved as reference documentation, even after moving to CSS variables for z-index management.

Applied to files:

  • packages/styles/src/vxe/index.css
  • apps/web-antd/src/bootstrap.ts
  • playground/src/bootstrap.ts
📚 Learning: 2024-11-05T10:34:13.846Z
Learnt from: ArthurDarkstoneRepo: vbenjs/vue-vben-admin PR: 4807File: docs/src/components/common-ui/vben-vxe-table.md:65-84Timestamp: 2024-11-05T10:34:13.846ZLearning: In `docs/src/components/common-ui/vben-vxe-table.md`, the code examples are provided within markdown scripts for documentation and do not require import statements or explicit type annotations.

Applied to files:

  • apps/web-antd/src/bootstrap.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: post-update (ubuntu-latest)
  • GitHub Check: post-update (windows-latest)
  • GitHub Check: Check (windows-latest)
  • GitHub Check: Test (windows-latest)
🔇 Additional comments (3)
packages/styles/package.json (1)

29-32:LGTM! Export structure is correct.

The new export entry follows the existing pattern and correctly maps to the vxe CSS file.

apps/web-antd/src/bootstrap.ts (1)

9-9:LGTM! Consistent style import placement.

The vxe styles import is correctly positioned with other global style imports at bootstrap time.

playground/src/bootstrap.ts (1)

9-9:LGTM! Consistent with web-antd bootstrap.

The vxe styles import mirrors the change inapps/web-antd/src/bootstrap.ts, ensuring consistent styling across different application entrypoints.

Comment on lines 3 to 9
.vxe-tooltip--wrapper {
z-index:2001!important;
}
/** 弹窗内表格组件层级问题修复 */
.vxe-select--panel {
z-index:2001!important;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

⚠️ Potential issue |🟠 Major

Verify the hardcoded z-index value aligns with modal z-index.

The CSS uses a hardcodedz-index: 2001 with!important to override vxe-table component defaults. While this addresses the immediate layering issue, consider:

  1. Hardcoded value: The z-index of 2001 should be verified against the actual modal z-index to ensure proper layering.
  2. Global scope: These rules apply to all vxe components globally, not just those within modals. This could have unintended effects on vxe components elsewhere in the application.

Run the following script to verify modal z-index values and check for existing z-index management patterns:

#!/bin/bash# Find modal/dialog z-index definitions and CSS variable patterns# Search for modal z-index configurationsecho"=== Modal/Dialog z-index configurations ==="rg -nP --type=ts --type=js -C3'modal.*z-?index|drawer.*z-?index|zIndex.*modal|zIndex.*drawer' -g'!node_modules' -g'!dist'# Search for CSS variables related to z-indexecho -e"\n=== CSS z-index variables ==="rg -nP --type=css --type=scss -C2'--.*z-?index|z-?index.*var\(' -g'!node_modules' -g'!dist'# Search for vxe-table z-index referencesecho -e"\n=== VXE-table z-index references ==="rg -nP -C3'vxe.*z-?index' -g'!node_modules' -g'!dist'
🤖 Prompt for AI Agents
In packages/styles/src/vxe/index.css around lines 3 to 9 the styles force aglobal z-index:2001 !important for vxe-tooltip--wrapper and vxe-select--panelwhich may conflict with modal stacking and affects all vxe components; run theprovided verification script to find existing modal/dialog z-index values andany CSS z-index variables, then replace the hardcoded value by scoping the rulesto the modal/dialog container (e.g. .modal .vxe-*) or using a CSS variable (e.g.z-index: var(--z-modal, 2001)) and remove !important so the modal z-indexcontrols stacking consistently; if multiple modal z-index values exist, choosethe variable to match the modal stack or set the vxe rules to compute relativeto the modal context (increase only when inside modal) to avoid global sideeffects.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@coderabbitaicoderabbitai[bot]coderabbitai[bot] left review comments

@anncwbanncwbAwaiting requested review from anncwbanncwb is a code owner

@vince292007vince292007Awaiting requested review from vince292007vince292007 is a code owner

@mynetfanmynetfanAwaiting requested review from mynetfanmynetfan is a code owner

@jinmao88jinmao88Awaiting requested review from jinmao88jinmao88 is a code owner

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@jyqwq

[8]ページ先頭

©2009-2025 Movatter.jp