-
Notifications
You must be signed in to change notification settings - Fork 266
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
fix(ip-address): fix ip-address and autocomplete component style issues #2307
Conversation
WalkthroughThe changes in this pull request involve updates to the Changes
Possibly related PRs
Suggested labels
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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 (
|
[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 |
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
examples/sites/demos/pc/app/autocomplete/slot-composition-api.vue (1)
90-90
: Good catch! Important syntax fix.Adding the missing semicolon at the end of the color property is a crucial fix. This ensures proper CSS syntax and prevents potential styling issues.
Consider using a linter or formatter to catch and automatically fix such syntax errors in the future.
examples/sites/demos/pc/app/autocomplete/slot.vue (1)
88-91
: Approved: Style improvements and fixesThe changes in the style section are beneficial:
- Increasing the width of .tiny-autocomplete improves visibility.
- Combining selectors for .pend-slot and .fix-slot reduces code duplication.
- Adding the missing semicolon ensures consistent code style.
These changes enhance the component's appearance and maintain code quality.
Consider using a CSS custom property (variable) for the width to make it easier to adjust globally in the future:
+:root { + --autocomplete-width: 300px; +} .demo-autocomplete .tiny-autocomplete { - width: 300px; + width: var(--autocomplete-width); }Also applies to: 97-97
packages/theme/src/ip-address/index.less (1)
30-32
: Approve changes with a suggestion for browser compatibilityThe new CSS rule for the disabled state cursor is a good addition to improve user experience. It correctly uses the
:has()
pseudo-class to apply thenot-allowed
cursor when a child<ul>
element has thedisabled
class.However, the
:has()
pseudo-class is a relatively new CSS feature and may not be supported in all browsers. Consider adding a fallback for better compatibility.Consider adding a fallback for browsers that don't support the
:has()
pseudo-class:.@{ip-address-prefix-cls} { &:has(> ul.disabled) { cursor: not-allowed; } /* Fallback for browsers that don't support :has() */ &.disabled { cursor: not-allowed; } }This way, you can add the
disabled
class to the root element as a fallback for browsers that don't support:has()
.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
- examples/sites/demos/pc/app/autocomplete/slot-composition-api.vue (1 hunks)
- examples/sites/demos/pc/app/autocomplete/slot.vue (1 hunks)
- packages/theme/src/ip-address/index.less (1 hunks)
🧰 Additional context used
🔇 Additional comments (4)
examples/sites/demos/pc/app/autocomplete/slot-composition-api.vue (2)
81-81
: LGTM. Verify layout impact.The increase in width from 270px to 300px for the autocomplete component looks good. This change may improve visibility and usability.
Please verify that this width increase doesn't negatively impact the overall layout or responsiveness of the page, especially on smaller screens.
81-90
: Overall assessment: Minor improvements with positive impact.The changes in this file, while minimal, contribute to better usability and code correctness:
- Increasing the autocomplete component width may enhance visibility.
- Fixing the CSS syntax error ensures proper styling behavior.
These modifications align well with the PR's objective of addressing style issues in the autocomplete component.
packages/theme/src/ip-address/index.less (2)
Line range hint
1-180
: Summary of changes and their impactThe modifications to the IP address component styles in this file effectively address the PR objectives. The key improvements are:
- Addition of a visual indicator (cursor: not-allowed) for disabled states, enhancing accessibility.
- Removal of
cursor: pointer;
from hover states, promoting consistent cursor behavior.These changes contribute to a better user experience and align with common UI practices. The overall structure of the LESS file remains well-organized, and the modifications are implemented correctly.
To ensure the changes meet all requirements, please verify that:
- The new styles are tested across different browsers for compatibility.
- The component's behavior aligns with the updated styles in various states (normal, hover, disabled).
- Any related documentation is updated to reflect these style changes.
Line range hint
1-180
: Approve removal ofcursor: pointer;
from hover statesThe removal of
cursor: pointer;
from hover states, as mentioned in the AI-generated summary, is a good change. This improves consistency in cursor behavior and aligns with common practices for form inputs.To ensure all instances of
cursor: pointer;
have been removed from hover states, please run the following command:If the command returns no results, it confirms that all instances have been removed as intended.
PR
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
tiny-autocomplete
components with improved slot configurations for better display of restaurant information.tiny-autocomplete
components from 270px to 300px..pend-slot
,.fix-slot
, and.default-slot-buttom
for proper styling.