Khan / Khan/live-editor

<title></title> preview shows last deleted character(s) vs. empty string

Open
#210 6 comments 0 reactions 0 assignees View on GitHub
bug webpage
Dominant language
JavaScript
Stars
776
Forks
180
PR merge metrics
No merged PRs in 30d

Description

I've been working through the HTML/CSS exercises with my daughters, and they are loving them--nice work! We noticed an issue with the preview for the document's title element, such that when you delete the existing title, it still shows the last letter of whatever was there vs. an empty string. My daughters couldn't understand why it was mismatched (e.g., showing a 'C' when there was nothing there in the code editor).

STR:
1. go to https://www.khanacademy.org/computing/computer-programming/html-css/intro-to-css/p/challenge-seasonal-ids
2. Move your cursor to the right of `Challenge: Seasonal ids`
3. Press delete/backspace and notice the preview Title updates as you type
4. Notice that when you delete everything (`<title>`) you still have a preview doc title of 'C'

If you simply highlight all of `Challenge: Seasonal ids` and press DEL it will show the full title.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue at the linked Khan Academy challenge by deleting the title text character by character in the HTML/CSS editor. Start by tracing how editor changes update the preview document title, then verify that an empty produces an empty preview title rather than retaining the last character.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.