fix: fix misbehaving greeting buttons so they work after 3+ attempts#10
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
dariushdev-sveltekit | 37b42d8 | Commit Preview URL Branch Preview URL |
Feb 17 2026, 11:52 PM |
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical bug where greeting link buttons (about, contact, social) stop working after 2-3 clicks when terminal content overflows. The issue occurs because focus() calls without preventScroll cause unwanted scrolling that moves buttons out from under the cursor, preventing click events from firing.
Changes:
- Added
{ preventScroll: true }option to focus() calls in TerminalInput.svelte and Terminal.svelte - Prevents browser from scrolling when refocusing the input element
- Ensures buttons remain under the cursor for successful click event completion
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/lib/components/TerminalInput.svelte | Added preventScroll: true to handleBlur focus call (primary fix) |
| src/routes/Terminal.svelte | Added preventScroll: true to handleLinkClick and focusInput methods |
…clickable after multiple commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After the second click on the greeting links (like about, contact and social), it did not send any commands or open any website.
This PR fixes it.
Root cause: handleBlur in [TerminalInput.svelte:33] calls focus() without preventScroll: true. After two commands produce enough content to overflow the terminal, clicking a greeting link at the top triggers this sequence:
mousedown on button → input loses focus → blur fires
handleBlur calls focus() → browser scrolls the terminal container down to show the input
The button moves out from under the cursor
mouseup fires on a different element → no click event → handleLinkClick never runs
Fix: Added { preventScroll: true } to three focus() calls:
[TerminalInput.svelte:35] — the primary fix
[Terminal.svelte:121] — prevents scroll when clicking terminal body
[Terminal.svelte:117] — prevents scroll after link click
Claude Opus