-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: navigator clipboard is not support in devtool panel #3600
base: canary
Are you sure you want to change the base?
fix: navigator clipboard is not support in devtool panel #3600
Conversation
🦋 Changeset detectedLatest commit: 165d24c The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
@komagic is attempting to deploy a commit to the NextUI Inc Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe changes introduce a new function, Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ClipboardAPI
participant CompatibilityLayer
User->>ClipboardAPI: Trigger copy action
alt Modern API available
ClipboardAPI-->>User: Copy text using navigator.clipboard
else Fallback needed
CompatibilityLayer-->>User: Create temporary input element
CompatibilityLayer->>CompatibilityLayer: Set input value to text
CompatibilityLayer->>CompatibilityLayer: Execute document.execCommand('copy')
alt Copy successful
CompatibilityLayer-->>User: Update state to copied
else Copy failed
CompatibilityLayer-->>User: Log error and update state to not copied
end
end
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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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: 3
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- packages/hooks/use-clipboard/src/index.ts (2 hunks)
Additional comments not posted (1)
packages/hooks/use-clipboard/src/index.ts (1)
39-39
: Check the result ofexecCommand
.The
execCommand('copy')
method returns a boolean indicating whether the command was successful. Ensure the result is checked correctly.let result = document.execCommand('copy'); // 尝试复制 - setCopied(result); + handleCopyResult(result);
9c7410c
to
e1d2515
Compare
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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- packages/hooks/use-clipboard/src/index.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/hooks/use-clipboard/src/index.ts
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.
- please add a changeset
- please lint your code
- please share how to reproduce the original issue
- please share the screen record to show the issue is solved with the PR change
please add a changeset (done) please share the screen record to show the issue is solved with the PR change (done) 20240806_235632.mp4@wingkwong 年轻的大佬帮忙看下有没有其他问题 |
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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- packages/hooks/use-clipboard/src/index.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/hooks/use-clipboard/src/index.ts
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, codebase verification and nitpick comments (1)
.changeset/plenty-ties-yell.md (1)
5-5
: Translate the changeset description to English for broader understanding.The description is in Chinese: "fix: useClipboard 兼容性修复 ,新增 compabilityCopy". It should be translated to ensure all contributors understand the changes.
- fix: useClipboard 兼容性修复 ,新增 compabilityCopy + fix: useClipboard compatibility fix, added compatibilityCopy
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- .changeset/plenty-ties-yell.md (1 hunks)
Additional comments not posted (1)
.changeset/plenty-ties-yell.md (1)
1-3
: Ensure the changeset header is correct.The changeset header seems appropriate for a major change. It specifies the package affected by the change.
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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- .changeset/nervous-students-carry.md (1 hunks)
Additional comments not posted (1)
.changeset/nervous-students-carry.md (1)
1-5
: Changeset looks good.The changeset file is correctly formatted and provides the necessary information about the major change to the
@nextui-org/use-clipboard
package.
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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- .changeset/nervous-students-carry.md (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- .changeset/nervous-students-carry.md
what will be next |
@wingkwong brother, i mean this pr |
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.
- please add test
- please share how to set up chrome extension devtool panel
- please resolve conflict
Closes #
📝 Description
⛳️ Current behavior (updates)
🚀 New behavior
💣 Is this a breaking change (Yes/No):
📝 Additional Information
Summary by CodeRabbit