Skip to content

Conversation

@jyqwq
Copy link
Contributor

@jyqwq jyqwq commented Dec 17, 2025

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 to pnpm-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 in CONTRIBUTING.

  • [ ✅ ] If you introduce new functionality, document it. You can run documentation with pnpm run docs:dev command.
  • [ ✅ ] Run the tests with pnpm 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 with feat:, fix:, perf:, docs:, or chore:.
  • [ ✅ ] 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-bot bot commented Dec 17, 2025

⚠️ 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

coderabbitai bot commented Dec 17, 2025

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
Added import '@vben/styles/vxe' to load the new styles at bootstrap.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify exports 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 name Status Explanation
Title check ✅ Passed The 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 ✅ Passed The 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 ✅ Passed No 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 between 1345fd7 and 6d746ba.

📒 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 using CodeRabbit! 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

@coderabbitai coderabbitai bot 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 between 1479f15 and 581b488.

📒 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: mynetfan
Repo: vbenjs/vue-vben-admin PR: 5397
File: playground/src/bootstrap.ts:23-30
Timestamp: 2025-01-15T04:29:13.944Z
Learning: 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: mynetfan
Repo: vbenjs/vue-vben-admin PR: 5397
File: playground/src/bootstrap.ts:23-30
Timestamp: 2025-01-15T04:29:13.944Z
Learning: 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: ArthurDarkstone
Repo: vbenjs/vue-vben-admin PR: 4807
File: docs/src/components/common-ui/vben-vxe-table.md:65-84
Timestamp: 2024-11-05T10:34:13.846Z
Learning: 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 in apps/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 hardcoded z-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 configurations
echo "=== 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-index
echo -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 references
echo -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 a
global z-index:2001 !important for vxe-tooltip--wrapper and vxe-select--panel
which may conflict with modal stacking and affects all vxe components; run the
provided verification script to find existing modal/dialog z-index values and
any CSS z-index variables, then replace the hardcoded value by scoping the rules
to 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-index
controls stacking consistently; if multiple modal z-index values exist, choose
the variable to match the modal stack or set the vxe rules to compute relative
to the modal context (increase only when inside modal) to avoid global side
effects.

@chenwei1109
Copy link

vxe-table有个z-index参数配置全局层级的,不需要你这么调整的

@chenwei1109
Copy link

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants