Skip to content

Tab not being focused when TextEdit is activated by drag #299

@dolezvo1

Description

@dolezvo1

Describe the bug
I'm honestly not sure if this isn't entirely my fault, but I noticed that a tab doesn't get focused when an egui::TextField is "activated" by mouse drag, which results in out-of-focus tab with focused input element, and that's messing up my code elsewhere.

To Reproduce
Steps to reproduce the behavior:

  1. Select text in a TextEdit on an out-of-focus tab by mouse drag
  2. Optionally, move the cursor using arrow keys to get rid of the selection
  3. The cursor is now inside the TextEdit, but the tab is not considered to be focused.

Expected behavior
I think it shouldn't be possible to have unfocused tab with a focused input element, because that sounds like a contradiction to me. I've noticed that "activating" the input with mouse click does focus the tab, so the behaviour is at the very least not consistent at the moment.

Screenshots
Here's a GIF of the behaviour. First the input field is "activated" using mouse drag, then the text selection is lost using arrow keys. That results in a focused input element on an unfocused tab.

Image

Additional context
I'm using version 0.18 with eframe 0.33.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions