fix(style): tooltip shown when no content
This commit is contained in:
@@ -74,13 +74,17 @@ const AutoTooltip: React.FC<AutoTooltipProps> = ({
|
||||
overlayInnerStyle={{ paddingInline: 0 }}
|
||||
destroyTooltipOnHide={false}
|
||||
title={
|
||||
<TitleTip
|
||||
isOverflowing={isOverflowing}
|
||||
title={title}
|
||||
showTitle={showTitle}
|
||||
>
|
||||
{children}
|
||||
</TitleTip>
|
||||
isOverflowing || showTitle ? (
|
||||
<TitleTip
|
||||
isOverflowing={isOverflowing}
|
||||
title={title}
|
||||
showTitle={showTitle}
|
||||
>
|
||||
{children}
|
||||
</TitleTip>
|
||||
) : (
|
||||
''
|
||||
)
|
||||
}
|
||||
{...tooltipProps}
|
||||
>
|
||||
|
||||
@@ -4,7 +4,6 @@ import '@xterm/xterm/css/xterm.css';
|
||||
import classNames from 'classnames';
|
||||
import _ from 'lodash';
|
||||
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import CopyButton from '../copy-button';
|
||||
import './index.less';
|
||||
import useParseAnsi from './parse-ansi';
|
||||
|
||||
@@ -127,9 +126,9 @@ const LogsViewer: React.FC<LogsViewerProps> = (props) => {
|
||||
|
||||
return (
|
||||
<div className="logs-viewer-wrap-w2">
|
||||
<span className="copy">
|
||||
{/* <span className="copy">
|
||||
<CopyButton text={copyText} type="text" size="small"></CopyButton>
|
||||
</span>
|
||||
</span> */}
|
||||
<div
|
||||
className="wrap"
|
||||
style={{ height: height }}
|
||||
|
||||
@@ -246,25 +246,26 @@ const MessageInput: React.FC<MessageInputProps> = ({
|
||||
};
|
||||
|
||||
const handleOnPaste = (e: any) => {
|
||||
e.preventDefault();
|
||||
// e.preventDefault();
|
||||
|
||||
const text = e.clipboardData.getData('text');
|
||||
if (text) {
|
||||
const startPos = e.target.selectionStart;
|
||||
const endPos = e.target.selectionEnd;
|
||||
setMessage?.({
|
||||
...message,
|
||||
content:
|
||||
message.content.slice(0, startPos) +
|
||||
text +
|
||||
message.content.slice(endPos)
|
||||
});
|
||||
if (endPos !== startPos) {
|
||||
setTimeout(() => {
|
||||
e.target.setSelectionRange(endPos, endPos);
|
||||
}, 0);
|
||||
}
|
||||
// const startPos = e.target.selectionStart;
|
||||
// const endPos = e.target.selectionEnd;
|
||||
// setMessage?.({
|
||||
// ...message,
|
||||
// content:
|
||||
// message.content.slice(0, startPos) +
|
||||
// text +
|
||||
// message.content.slice(endPos)
|
||||
// });
|
||||
// if (endPos !== startPos) {
|
||||
// setTimeout(() => {
|
||||
// e.target.setSelectionRange(endPos, endPos);
|
||||
// }, 0);
|
||||
// }
|
||||
} else {
|
||||
e.preventDefault();
|
||||
getPasteContent(e);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -105,23 +105,24 @@ const ContentItem: React.FC<MessageItemProps> = ({
|
||||
);
|
||||
|
||||
const handleOnPaste = (e: any) => {
|
||||
e.preventDefault();
|
||||
// e.preventDefault();
|
||||
const text = e.clipboardData.getData('text');
|
||||
if (text) {
|
||||
const startPos = e.target.selectionStart;
|
||||
const endPos = e.target.selectionEnd;
|
||||
updateMessage?.({
|
||||
role: data.role,
|
||||
content:
|
||||
data.content.slice(0, startPos) + text + data.content.slice(endPos),
|
||||
uid: data.uid
|
||||
});
|
||||
if (endPos !== startPos) {
|
||||
setTimeout(() => {
|
||||
e.target.setSelectionRange(endPos, endPos);
|
||||
}, 0);
|
||||
}
|
||||
// const startPos = e.target.selectionStart;
|
||||
// const endPos = e.target.selectionEnd;
|
||||
// updateMessage?.({
|
||||
// role: data.role,
|
||||
// content:
|
||||
// data.content.slice(0, startPos) + text + data.content.slice(endPos),
|
||||
// uid: data.uid
|
||||
// });
|
||||
// if (endPos !== startPos) {
|
||||
// setTimeout(() => {
|
||||
// e.target.setSelectionRange(endPos, endPos);
|
||||
// }, 0);
|
||||
// }
|
||||
} else {
|
||||
e.preventDefault();
|
||||
getPasteContent(e);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user