summaryrefslogtreecommitdiff
path: root/extension/react-app/src/components/ComboBox.tsx
diff options
context:
space:
mode:
authorTy Dunn <ty@tydunn.com>2023-06-18 19:24:28 -0700
committerTy Dunn <ty@tydunn.com>2023-06-18 19:24:28 -0700
commit5311a5b7e8e4322690b5f0b85a839bfa1caa1926 (patch)
tree236b1699f987ff90f89d905ba4ded7e49b3b8d96 /extension/react-app/src/components/ComboBox.tsx
parentd3f76defe286df20550cbcc87679b56d9f6c72c2 (diff)
parent8aa8e0b5c8402014b01f6ea6ce2e3d686f3c64b2 (diff)
downloadsncontinue-5311a5b7e8e4322690b5f0b85a839bfa1caa1926.tar.gz
sncontinue-5311a5b7e8e4322690b5f0b85a839bfa1caa1926.tar.bz2
sncontinue-5311a5b7e8e4322690b5f0b85a839bfa1caa1926.zip
Merge branch 'main' into play-button
Diffstat (limited to 'extension/react-app/src/components/ComboBox.tsx')
-rw-r--r--extension/react-app/src/components/ComboBox.tsx9
1 files changed, 9 insertions, 0 deletions
diff --git a/extension/react-app/src/components/ComboBox.tsx b/extension/react-app/src/components/ComboBox.tsx
index ddc9d5dc..8c1f80e0 100644
--- a/extension/react-app/src/components/ComboBox.tsx
+++ b/extension/react-app/src/components/ComboBox.tsx
@@ -116,6 +116,15 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => {
disabled={props.disabled}
placeholder="Type '/' to see available slash commands."
{...getInputProps({
+ onChange: (e) => {
+ const target = e.target as HTMLTextAreaElement;
+ // Update the height of the textarea to match the content, up to a max of 200px.
+ target.style.height = "auto";
+ target.style.height = `${Math.min(
+ target.scrollHeight,
+ 200
+ ).toString()}px`;
+ },
onKeyDown: (event) => {
if (event.key === "Enter" && event.shiftKey) {
// Prevent Downshift's default 'Enter' behavior.