Files
Elvira Khabirova 87f7b1d8a6 Always focus on the window when there is no selection
Selection.rangeCount can return 1 when there is no selection,
it is enough for a selection to have been present in the past
or for the user to have clicked on the page.

See MDN: https://developer.mozilla.org/en-US/docs/Web/API/Selection/rangeCount

Use Selection.isCollapsed to be entirely sure there is a selection
before ignoring the click.

This change fixes the issue ish-app/ish#2519, where focus to the terminal
is lost and can not be regained, forcing the user to restart ish.

Tested on iPad Pro 13-inch (M4) with iPadOS 26 Beta 2 and Stage Manager.

Signed-off-by: Elvira Khabirova <lineprinter0@gmail.com>
2025-06-29 11:00:31 +02:00
..
2020-12-05 23:53:17 -08:00
2019-09-06 23:30:41 -07:00