Bug 235223 - REGRESSION(iOS 15): getSelection() is successful rarely, on onclick event
Summary: REGRESSION(iOS 15): getSelection() is successful rarely, on onclick event
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Safari 15
Hardware: iPhone / iPad iOS 15
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-14 01:04 PST by Takao Baba
Modified: 2023-03-23 18:27 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Takao Baba 2022-01-14 01:04:34 PST
# Steps to reproduce:

1. Open https://jsbin.com/pubipidaxu/edit?html,js,output by Safari on iOS 15.
2. Long-press "Hello". Make sure the text is selected.
3. Touch "click" button.

# Expected behavior:

Alert with text "Hello" is shown. (I'm not care whether the selection remains or not.)

# Actual behaviro:

In most cases, alert with no text is shown. Sometimes works correctly.

# Note

On iOS 14, getSelection() can always get the text. The selection seems remain though it become invisible at the click.

Other browsers such as Android Chrome and desktop browsers do not have this issue: the selection remains after the click.
Comment 1 Radar WebKit Bug Importer 2022-01-21 01:05:16 PST
<rdar://problem/87873363>
Comment 2 Ryosuke Niwa 2023-03-23 18:27:39 PDT
This seems to work on iOS 16.4.