Skip to content

A platform for community discussion. Free, open, simple.

FIX: supports pre-iOS 26 callout positioning heuristic (#35907)

Joffrey JAFFEUXdc8c1c80be67
diff --git a/frontend/discourse/app/components/post-text-selection.gjs b/frontend/discourse/app/components/post-text-selection.gjs
index ab7bafce04a..2b93d809819 100644
--- a/frontend/discourse/app/components/post-text-selection.gjs
+++ b/frontend/discourse/app/components/post-text-selection.gjs
@@ -259,6 +259,10 @@ export default class PostTextSelection extends Component {
return cooked;
}
+ get usePostIOS26Heuristic() {
+ return this.capabilities.isIOS && "URLPattern" in globalThis;
+ }
+
get post() {
return this.args.topic.postStream.findLoadedPost(
this.args.quoteState.postId
@@ -278,7 +282,7 @@ export default class PostTextSelection extends Component {
shouldRenderBelow() {
const { isIOS, isAndroid, isOpera, isFirefox, touch } = this.capabilities;
- if (isIOS) {
+ if (this.usePostIOS26Heuristic) {
const rect = virtualElementFromTextRange().rect;
const spaceAbove = rect.top;
const spaceBelow = window.innerHeight - rect.bottom;
@@ -297,6 +301,7 @@ export default class PostTextSelection extends Component {
return (
this.capabilities.isMobileDevice ||
+ isIOS ||
isAndroid ||
isOpera ||
(touch && isFirefox)