-
Notifications
You must be signed in to change notification settings - Fork 310
fix: fix mobile-first long word bug #3228
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
Conversation
WalkthroughThis pull request updates the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
packages/vue/src/form-item/src/mobile-first.vueOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-vue". (The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js » @antfu/eslint-config » @antfu/eslint-config-vue". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (2)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Walkthrough此PR修复了在移动优先设计中,表单展示时超长单词导致标签超出显示区域的问题。通过调整CSS样式,确保超长文本不会影响布局。 Changes
|
@@ -26,7 +26,7 @@ | |||
v-if="slots.label || label" | |||
:class=" | |||
m( | |||
'py-3 sm:py-1.5 sm:min-h-[theme(spacing.7)] relative align-bottom float-left text-sm pr-3 sm:pr-4 box-border leading-5', | |||
'py-3 sm:py-1.5 sm:min-h-[theme(spacing.7)] relative align-bottom float-left text-sm pr-3 sm:pr-4 box-border leading-5 shrink-0', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding shrink-0
ensures that the label does not shrink, which is important for maintaining layout integrity when long words are present.
@@ -73,7 +73,7 @@ | |||
data-tag="tiny-form-item-inline" | |||
:class=" | |||
m( | |||
`flex-1 m-0 sm:m-auto relative sm:pt-0 sm:top-auto text-sm after:content-[''] after:table after:clear-both before:content-[''] before:table [&_button:not(:last-child)]:mr-2`, | |||
`min-w-0 flex-1 m-0 sm:m-auto relative sm:pt-0 sm:top-auto text-sm after:content-[''] after:table after:clear-both before:content-[''] before:table [&_button:not(:last-child)]:mr-2`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The addition of min-w-0
is crucial for preventing overflow issues with long words, ensuring that the flex container can shrink appropriately.
WalkthroughThis PR fixes the issue where excessively long words are caused to labels exceed the display area when presenting forms in mobile-first design. By adjusting the CSS style, ensure that extra-long text does not affect the layout. Changes
|
[e2e-test-warn] The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug". Please make sure you've read our contributing guide |
PR
修复表单仅展示时,超长文本显示Bug.


修改前:
遇到超长“单词“会将标签定出显示区。
修改后:
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit