Skip to content

Commit 681d02c

Browse files
committed
fix: address CodeRabbit accessibility and responsive suggestions
1 parent 090b1f7 commit 681d02c

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/components/Chatbot/ChatbotWidget.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ export default function ChatbotWidget() {
189189
};
190190

191191
const handleKey = (e: React.KeyboardEvent<HTMLInputElement>) => {
192-
if (e.key === "Enter") sendMessage();
193-
};
192+
if (e.key === "Enter" && !e.nativeEvent.isComposing) sendMessage();
193+
};
194194

195195
const quickQuestions = [
196196
"How do I get a GitHub token?",
@@ -242,8 +242,8 @@ export default function ChatbotWidget() {
242242
position: "fixed",
243243
bottom: "100px",
244244
right: "28px",
245-
width: "360px",
246-
maxHeight: "560px",
245+
width: "min(360px, calc(100vw - 32px))",
246+
maxHeight: "min(560px, calc(100vh - 120px))",
247247
borderRadius: "16px",
248248
background: "linear-gradient(160deg, #0f172a 0%, #1e293b 100%)",
249249
border: "1px solid rgba(99,102,241,0.3)",
@@ -471,6 +471,8 @@ export default function ChatbotWidget() {
471471
value={input}
472472
onChange={(e) => setInput(e.target.value)}
473473
onKeyDown={handleKey}
474+
onFocus={(e) => { e.currentTarget.style.boxShadow = "0 0 0 2px rgba(99,102,241,0.6)"; }}
475+
onBlur={(e) => { e.currentTarget.style.boxShadow = "none"; }}
474476
placeholder="Ask me anything..."
475477
style={{
476478
flex: 1,

0 commit comments

Comments
 (0)