-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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(theme): removed pseudo cancel btn from input #3912
fix(theme): removed pseudo cancel btn from input #3912
Conversation
🦋 Changeset detectedLatest commit: 7fffe11 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@sanuj21 is attempting to deploy a commit to the NextUI Inc Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThis pull request introduces a patch for the Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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
Documentation and Community
|
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 (1)
packages/core/theme/src/components/input.ts (1)
49-49
: LGTM! Consider adding a comment for clarity.The addition of the
"input-search-cancel-button-none"
class effectively addresses the issue of the unintended cancel button in search inputs. This change aligns well with the PR objective and doesn't introduce any side effects to other component variants.For improved maintainability, consider adding a brief comment explaining the purpose of this class, such as:
input: [ "w-full font-normal bg-transparent !outline-none placeholder:text-foreground-500 focus-visible:outline-none", "data-[has-start-content=true]:ps-1.5", "data-[has-end-content=true]:pe-1.5", "file:cursor-pointer file:bg-transparent file:border-0", "autofill:bg-transparent bg-clip-text", + // Hides the browser's default cancel button in search inputs "input-search-cancel-button-none", ],
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (3)
- .changeset/forty-doors-flash.md (1 hunks)
- packages/core/theme/src/components/input.ts (1 hunks)
- packages/core/theme/src/utilities/custom.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
- .changeset/forty-doors-flash.md
🧰 Additional context used
🔇 Additional comments (1)
packages/core/theme/src/utilities/custom.ts (1)
20-24
: Approved: Effectively addresses the Chrome-specific issue.The implementation correctly targets the WebKit search cancel button and hides it, which aligns with the PR objectives to remove the unintended cancel button in Chrome.
However, consider the following suggestions:
- Cross-browser compatibility: This solution is WebKit-specific. Consider adding similar rules for other browsers if they have equivalent pseudo-elements.
- Documentation: Add a comment explaining the purpose of this utility class and its browser limitations.
Consider adding a comment above the utility class for clarity:
+ // Hides the WebKit-specific search input cancel button ".input-search-cancel-button-none": { "&::-webkit-search-cancel-button": { "-webkit-appearance": "none", }, },
Let's check if there are any non-WebKit specific solutions or if other browsers need similar treatment:
✅ Verification successful
Let's re-verify the codebase for other browser-specific input cancel button styles by running the following scripts:
Verified: No additional browser-specific styles found.
The implementation effectively addresses the Chrome-specific issue. As no other browser-specific input cancel button styles were detected in the codebase, no additional cross-browser adjustments are necessary at this time.
It is recommended to document the WebKit-specific styling and its limitations.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Search for browser-specific input cancel button styles # Test: Search for other browser-specific cancel button styles rg --type css -i '(search-cancel-button|clear-button)' # Test: Search for general input styling that might affect cancel buttons rg --type css -i 'input\[type="search"\]'Length of output: 100
Script:
#!/bin/bash # Description: Search for browser-specific input cancel button styles # Search for WebKit-specific cancel button styles rg --type css '::-webkit-search-cancel-button' # Search for Mozilla-specific clear button styles rg --type css '::-moz-search-cancel-button' # Search for general search input modifiers that might affect cancel buttons rg --type css 'input\[type="search"\]'Length of output: 131
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
@wingkwong I checked it again its working while running with storybook. |
I also tested in storybook only. Which browser were you testing in? |
Closes #3907
📝 Description
Pseudo Cancel Button used to come with input element in chrome unintentionally when the input type is search.
⛳️ Current behavior (updates)
Pseudo Cancel Button comes with input element in chrome when the type is search.
🚀 New behavior
Removed the cancel button which was unintentional.
💣 Is this a breaking change (Yes/No):
No
📝 Additional Information
Summary by CodeRabbit
New Features
Bug Fixes
<Input />
#3907.