Skip to content

Commit 03b6d11

Browse files
authored
Fixing Attachment opening in input bug (#334)
* Fixing Attachment opening in input bug * Removing Focused state * adding css for input border
1 parent ac139af commit 03b6d11

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

packages/jupyter-chat/src/components/input/chat-input.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export function ChatInput(props: ChatInput.IProps): JSX.Element {
4646
const [toolbarElements, setToolbarElements] = useState<
4747
InputToolbarRegistry.IToolbarItem[]
4848
>([]);
49-
const [isFocused, setIsFocused] = useState<boolean>(false);
5049
const [writers, setWriters] = useState<IChatModel.IWriter[]>([]);
5150

5251
/**
@@ -214,9 +213,7 @@ export function ChatInput(props: ChatInput.IProps): JSX.Element {
214213
<Box
215214
sx={{
216215
border: '1px solid',
217-
borderColor: isFocused
218-
? 'var(--jp-brand-color1)'
219-
: 'var(--jp-border-color1)',
216+
borderColor: 'var(--jp-border-color1)',
220217
borderRadius: 2,
221218
transition: 'border-color 0.2s ease',
222219
display: 'flex',
@@ -262,8 +259,6 @@ export function ChatInput(props: ChatInput.IProps): JSX.Element {
262259
onKeyDown={handleKeyDown}
263260
placeholder="Type a chat message, @ to mention..."
264261
inputRef={inputRef}
265-
onFocus={() => setIsFocused(true)}
266-
onBlur={() => setIsFocused(false)}
267262
onSelect={() =>
268263
(model.cursorIndex = inputRef.current?.selectionStart ?? null)
269264
}

packages/jupyter-chat/style/input.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@
4545
.jp-chat-input-toolbar .jp-chat-send-include-opener {
4646
padding: 4px 0;
4747
}
48+
49+
.jp-chat-input-container:focus-within > div:first-of-type {
50+
border-color: var(--jp-brand-color1);
51+
}

0 commit comments

Comments
 (0)