Skip to content

Commit bfae326

Browse files
committed
Refactor the submit chevron button in ChatInput to use a nested span for better control over CSS transitions and toggling
1 parent 75f81fd commit bfae326

2 files changed

Lines changed: 22 additions & 6 deletions

File tree

‎packages/ui/src/components/editor/panel/ChatInput/ChatInput.module.scss‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,15 @@
228228
padding: 0 var(--padding-2px);
229229
}
230230

231-
&--chevron.codicon::before {
232-
font-size: 11px;
231+
&--chevron {
232+
> span.codicon::before {
233+
font-size: 11px;
234+
transition: transform 0.2s ease-in-out;
235+
}
236+
}
237+
238+
&--toggled {
239+
transform: rotate(180deg);
233240
}
234241

235242
&--copy {

‎packages/ui/src/components/editor/panel/ChatInput/ChatInput.tsx‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,22 @@ export const ChatInput: React.FC<ChatInputProps> = (props) => {
278278
<button
279279
className={cn(
280280
styles['footer__right__submit__button'],
281-
styles['footer__right__submit__button--chevron'],
282-
'codicon',
283-
'codicon-chevron-down'
281+
styles['footer__right__submit__button--chevron']
284282
)}
285283
onClick={toggle_dropdown}
286284
title="More actions"
287-
/>
285+
>
286+
<span
287+
className={cn(
288+
{
289+
[styles['footer__right__submit__button--toggled']]:
290+
is_dropdown_open
291+
},
292+
'codicon',
293+
'codicon-chevron-down'
294+
)}
295+
/>
296+
</button>
288297
{is_dropdown_open && (
289298
<div className={styles['footer__right__submit__dropdown']}>
290299
<div

0 commit comments

Comments
 (0)