Khan / Khan/live-editor

selection highlight becomes invisible but is still active

Open
#575 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
776
Forks
180
PR merge metrics
No merged PRs in 30d

Description

### Summary

When duplicating a selection or
when the fill and stroke command auto completes,
then the selection highlight is visible for a split second,
then it becomes invisible, but it's still active.

If a character is typed then the invisible selection
gets replaced with that character.

P.S.
The selection doesn't need to be duplicated first,
(that's just when it was discovered).
It's enough to just select some text, and moving it
in the editor by pressing: TAB and shift + TAB to
indent and unindent the text to see that the
selection highlight disappears.
### Expected behavior

As long as a selection is active, then it's highlight should remain visible.
### Actual behavior

With some text selected and a duplication hotkey is pressed:
shift + ctrl + d, (duplicates the selected text, after the selection)
or
shift + alt + up (or down), (duplicates the selected lines either above or below the selection)
then the selected text or lines are duplicated.

The selection highlight appears on the duplicated text or lines
for a split second before the highlight becomes invisible.

The same thing happens when typing "fill(", and "stroke(".
"fill(" auto completes to: "fill(255, 0, 0);"
the color values "255, 0, 0" gets a blue selection highlight
for a split second, before the selection becomes invisible.
### Steps to reproduce
1. Type: `point(50,50);`
2. Select the line with the mouse or the hotkey: ctrl + a
3. Duplicate the selection below with the hotkey: shift + alt + down

The line gets duplicated, but the selection only appears for a split second before it disappears.

The selection appearing for a split second can be repeated by pressing:
TAB and shift + TAB to indent and unindent.

The selection is still active but not visible, typing something will replace it.
### Environment
- Operating system and version:
- Windows 7 Home Premium 64 bit
- Browser
- Google Chrome Version 49.0.2623.112 m

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue in the browser editor using the selection, duplication hotkeys, TAB/Shift+TAB, and fill()/stroke() autocomplete steps. Trace the selection update and rendering behavior after those actions; done means an active selection remains visibly highlighted while typing still replaces it.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.