Fix touch screen defocus bug

Fixes https://github.com/emilk/egui/issues/288
This commit is contained in:
Emil Ernerfeldt 2021-04-12 21:41:07 +02:00
parent 5d50fa1350
commit 4ecf304335
2 changed files with 4 additions and 1 deletions

View file

@ -10,6 +10,9 @@ NOTE: [`eframe`](eframe/CHANGELOG.md), [`egui_web`](egui_web/CHANGELOG.md) and [
### Added ⭐
* Make labels interactive with `Label::sense(Sense::click())`.
### Fixed 🐛
* Fix [defocus-bug on touch screens](https://github.com/emilk/egui/issues/288)
## 0.11.0 - 2021-04-05 - Optimization, screen reader & new layout logic
### Added ⭐

View file

@ -146,7 +146,7 @@ impl Response {
// even if we aren't clickable. This is important for windows and such that should close
// then the user clicks elsewhere.
let pointer = &self.ctx.input().pointer;
if let Some(pos) = pointer.latest_pos() {
if let Some(pos) = pointer.interact_pos() {
pointer.any_click() && !self.rect.contains(pos)
} else {
false