Skip to content

Blur is not visible on iOS 26Β #168

@kurochkaand

Description

@kurochkaand

I upgraded my iOS version to the new iOS 26 and now there is no blur behind preview card.

Example Code:
Parent component:

<PostWrapper >
<PostComponent />
</PostWrapper>

Content of PostWrapper.tsx:

import Constants, { ExecutionEnvironment } from "expo-constants"
import React, { FC } from "react"
import { Alert, Platform, View } from "react-native"
import ContextMenu, { ContextMenuAction } from "react-native-context-menu-view"

interface PostWrapperProps {
  children: React.ReactNode
}

const Icons = Platform.select({
  ios: {
    report: "exclamationmark.triangle",
    delete: "trash",
    blockCircle: "multiply.circle",
  },
  android: {
    report: "exclamationmark_triangle",
    delete: "baseline_delete",
    blockCircle: "multiply_circle",
  },
})

const canUseNativeContextMenu =
  Constants.executionEnvironment === ExecutionEnvironment.Bare &&
  ((Platform.OS === "ios" && parseInt(String(Platform.Version), 10) >= 13) ||
    Platform.OS === "android")

export const PostWrapper: FC<PostWrapperProps> = ({ children }) => {
  const actions: ContextMenuAction[] = [
    { title: "Report post", systemIcon: Icons?.report },
    {
      title: "Delete Post",
      systemIcon: Icons?.delete,

      destructive: true,
    },
    { title: "Block user", systemIcon: Icons?.blockCircle },
  ]

  if (canUseNativeContextMenu) {
    return (
      <ContextMenu
        previewBackgroundColor={"transparent"}
        actions={actions}
        onPress={(event) => {
          const { index } = event.nativeEvent
          if (index === 0) {
            Alert.alert("Reported!")
          } else if (index === 1) {
            Alert.alert("Deleted!")
          } else if (index == 2) {
            Alert.alert("Blocked!")
          }
        }}
      >
        <View nativeID="WORKAROUND">{children}</View>
      </ContextMenu>
    )
  } else {
    return <View nativeID="WORKAROUND">{children}</View>
  }
}

Expected Behavior:
After Long press on the post it pops up, context menu appears next to it and everything else is blurred.

Actual Behavior:
Post pops up, context menu appears but no blur.

Environment
[email protected]
[email protected]
[email protected]

Platform: iOS (tested on device on ios 26)

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions