emilk / emilk/egui

Input not focused when selecting text

Open
#4,563 0 comments 0 reactions 0 assignees View on GitHub
web
Dominant language
Rust
Stars
30.6k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
72

Description

Repro:
1. Open Demos -> Widget Gallery on the [web demo](https://egui.rs)
2. Run `setInterval(() => console.log(document.activeElement), 1000)` in a devtools console
3. Type something into the first text field
4. Click somewhere outside of the text field to blur it
5. Select the text by dragging over it - make sure the text field is blurred!

Expected behavior: `runner.mutable_text_under_cursor` is set to `true`, causing the `` element to be the `document.activeElement`
Actual behavior: `runner.mutable_text_under_cursor` is `false`, and `document.activeElement == document.body`

Contributor guide

Open the contributing guide

Research direction

Start with the Demos → Widget Gallery web demo and trace the code that updates runner.mutable_text_under_cursor during text selection. Use the provided document.activeElement check to reproduce the blurred-field case. Done means selecting text in the blurred field sets the flag to true and focuses the input element.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, rust, wasm
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.