Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable text selection in WKWebView mode #3846

Closed
5 tasks done
fungc-io opened this issue Feb 26, 2024 · 6 comments
Closed
5 tasks done

Disable text selection in WKWebView mode #3846

fungc-io opened this issue Feb 26, 2024 · 6 comments
Assignees
Labels
pitch/authuiv2 ux/minor > 20% users will notice the issue as a problem

Comments

@fungc-io
Copy link
Member

fungc-io commented Feb 26, 2024


When the developers use WKWebView UI mode, they expect an experience as close to native as possible
which the text on the interface should not be selectable

See if we can disable text selection in this mode?

Image

@fungc-io fungc-io added ux/minor > 20% users will notice the issue as a problem pitch/authuiv2 labels Feb 26, 2024
@tung2744
Copy link
Contributor

@fungc-io What do you think if we always disable text selection in auth ui?

@fungc-io
Copy link
Member Author

ok 👍

@louischan-oursky
Copy link
Collaborator

I think we should keep text selection. It feels more natural on the web.

@tung2744
Copy link
Contributor

🤔 Then we need to use something such as query parameter to determine if it is inside webview.

@louischan-oursky
Copy link
Collaborator

louischan-oursky commented Feb 28, 2024

I think we can fix this in the WKWebView. For example, inject a small JavaScript to run document.body.style.userSelect = 'none';

https://developer.mozilla.org/en-US/docs/Web/CSS/user-select
The doc says that the default value of auto behaves much like inherited. So we only need to set user-select: none on <body>

Note: user-select is not an inherited property, though the initial auto value makes it behave like it is inherited most of the time. WebKit/Chromium-based browsers do implement the property as inherited, which violates the behavior described in the spec, and this will bring some issues. Until now, Chromium has chosen to fix the issues to make the final behavior meet the specifications.

@louischan-oursky
Copy link
Collaborator

Some SDKs are still missing this fix.

IniZio added a commit to IniZio/authgear-sdk-android that referenced this issue Mar 7, 2024
IniZio added a commit to IniZio/authgear-sdk-android that referenced this issue Mar 7, 2024
IniZio added a commit to IniZio/authgear-sdk-android that referenced this issue Mar 7, 2024
IniZio added a commit to IniZio/authgear-sdk-flutter that referenced this issue Mar 7, 2024
IniZio added a commit to IniZio/authgear-sdk-flutter that referenced this issue Mar 7, 2024
IniZio added a commit to IniZio/authgear-sdk-android that referenced this issue Mar 7, 2024
IniZio added a commit to IniZio/authgear-sdk-js that referenced this issue Mar 7, 2024
IniZio added a commit to IniZio/authgear-sdk-js that referenced this issue Mar 7, 2024
louischan-oursky pushed a commit to IniZio/authgear-sdk-android that referenced this issue Mar 8, 2024
IniZio added a commit to IniZio/authgear-sdk-flutter that referenced this issue Mar 8, 2024
IniZio added a commit to IniZio/authgear-sdk-js that referenced this issue Mar 8, 2024
louischan-oursky added a commit to authgear/authgear-sdk-js that referenced this issue Mar 8, 2024
@fungc-io fungc-io closed this as completed Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pitch/authuiv2 ux/minor > 20% users will notice the issue as a problem
Projects
None yet
Development

No branches or pull requests

4 participants