Unverified 提交 76054c6d authored 作者: Adeniji Adekunle James's avatar Adeniji Adekunle James 提交者: GitHub

fix(ui): prevent content click from toggling accordion and improve UX with…

fix(ui): prevent content click from toggling accordion and improve UX with cursor-text in Codeblock (#930) Hovering over the code block previously showed a pointer cursor, and clicking inside would collapse/expand the accordion. This PR updates the DyadWrite component to use `cursor-text` and adds `e.stopPropagation()` so clicks inside the code block no longer toggle the accordion, making it behave like other AI tools and improving user friendliness. Before https://github.com/user-attachments/assets/7b6983fd-91a0-4f30-9337-d444cbfcc110 After https://github.com/user-attachments/assets/07d0d765-7206-4552-b0b4-2665d87df4a1
上级 c4420a56
......@@ -94,7 +94,10 @@ export const DyadWrite: React.FC<DyadWriteProps> = ({
</div>
)}
{isContentVisible && (
<div className="text-xs">
<div
className="text-xs cursor-text"
onClick={(e) => e.stopPropagation()}
>
<CodeHighlight className="language-typescript">
{children}
</CodeHighlight>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论