Skip to content

Commit 601ede7

Browse files
authored
Merge pull request #577 from psv2522/fix-issue-562
fix:Added correct styling for the select options
2 parents 6b3fffc + 2d65b8a commit 601ede7

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

webview-ui/src/components/chat/ChatTextArea.tsx

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,11 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
511511
appearance: "none" as const,
512512
}
513513

514+
const optionStyle = {
515+
backgroundColor: "var(--vscode-dropdown-background)",
516+
color: "var(--vscode-dropdown-foreground)",
517+
}
518+
514519
const caretContainerStyle = {
515520
position: "absolute" as const,
516521
left: 6,
@@ -731,20 +736,21 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
731736
flex: "0 0 auto",
732737
}}>
733738
{getAllModes(customModes).map((mode) => (
734-
<option
735-
key={mode.slug}
736-
value={mode.slug}
737-
style={{
738-
backgroundColor: "var(--vscode-dropdown-background)",
739-
color: "var(--vscode-dropdown-foreground)",
740-
}}>
739+
<option key={mode.slug} value={mode.slug} style={{ ...optionStyle }}>
741740
{mode.name}
742741
</option>
743742
))}
744-
<option disabled style={{ borderTop: "1px solid var(--vscode-dropdown-border)" }}>
743+
<option
744+
disabled
745+
style={{
746+
borderTop: "1px solid var(--vscode-dropdown-border)",
747+
...optionStyle,
748+
}}>
745749
────
746750
</option>
747-
<option value="prompts-action">Edit...</option>
751+
<option value="prompts-action" style={{ ...optionStyle }}>
752+
Edit...
753+
</option>
748754
</select>
749755
<div style={caretContainerStyle}>
750756
<CaretIcon />
@@ -784,16 +790,22 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
784790
key={config.name}
785791
value={config.name}
786792
style={{
787-
backgroundColor: "var(--vscode-dropdown-background)",
788-
color: "var(--vscode-dropdown-foreground)",
793+
...optionStyle,
789794
}}>
790795
{config.name}
791796
</option>
792797
))}
793-
<option disabled style={{ borderTop: "1px solid var(--vscode-dropdown-border)" }}>
798+
<option
799+
disabled
800+
style={{
801+
borderTop: "1px solid var(--vscode-dropdown-border)",
802+
...optionStyle,
803+
}}>
794804
────
795805
</option>
796-
<option value="settings-action">Edit...</option>
806+
<option value="settings-action" style={{ ...optionStyle }}>
807+
Edit...
808+
</option>
797809
</select>
798810
<div style={caretContainerStyle}>
799811
<CaretIcon />

0 commit comments

Comments
 (0)