diff --git a/packages/pluggableWidgets/intro-screen-native/CHANGELOG.md b/packages/pluggableWidgets/intro-screen-native/CHANGELOG.md index adc726637..daa04a665 100644 --- a/packages/pluggableWidgets/intro-screen-native/CHANGELOG.md +++ b/packages/pluggableWidgets/intro-screen-native/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Fixed + +- We fixed an issue where using the conditional visibility on the IntroScreen would cause the widget not to render. + ## [4.1.0] - 2025-7-7 - Initial slide now correctly positioned on mount. diff --git a/packages/pluggableWidgets/intro-screen-native/package.json b/packages/pluggableWidgets/intro-screen-native/package.json index cd616bdfc..a30737ad3 100644 --- a/packages/pluggableWidgets/intro-screen-native/package.json +++ b/packages/pluggableWidgets/intro-screen-native/package.json @@ -1,7 +1,7 @@ { "name": "intro-screen-native", "widgetName": "IntroScreen", - "version": "4.2.0", + "version": "4.2.1", "license": "Apache-2.0", "repository": { "type": "git", diff --git a/packages/pluggableWidgets/intro-screen-native/src/IntroScreen.tsx b/packages/pluggableWidgets/intro-screen-native/src/IntroScreen.tsx index e19fd086d..37ca8c1c0 100644 --- a/packages/pluggableWidgets/intro-screen-native/src/IntroScreen.tsx +++ b/packages/pluggableWidgets/intro-screen-native/src/IntroScreen.tsx @@ -1,7 +1,7 @@ import { useCallback, useEffect, useState, JSX } from "react"; import { defaultWelcomeScreenStyle, IntroScreenStyle } from "./ui/Styles"; import { IntroScreenProps } from "../typings/IntroScreenProps"; -import { Modal, View } from "react-native"; +import { InteractionManager, Modal, View } from "react-native"; import { DynamicValue, ValueStatus } from "mendix"; import { SwipeableContainer } from "./SwipeableContainer"; import AsyncStorage from "@react-native-async-storage/async-storage"; @@ -22,7 +22,7 @@ export function IntroScreen(props: IntroScreenProps): JSX.Elem setVisible(value === "" || value === null); }); } else { - setVisible(true); + InteractionManager.runAfterInteractions(() => setVisible(true)); } }, [props.identifier]); @@ -30,7 +30,7 @@ export function IntroScreen(props: IntroScreenProps): JSX.Elem if (props.identifier) { AsyncStorage.setItem(props.identifier, "gone").then(() => setVisible(false)); } else { - setVisible(false); + InteractionManager.runAfterInteractions(() => setVisible(false)); } }, [props.identifier]); diff --git a/packages/pluggableWidgets/intro-screen-native/src/__tests__/__snapshots__/IntroScreen.notch.spec.tsx.snap b/packages/pluggableWidgets/intro-screen-native/src/__tests__/__snapshots__/IntroScreen.notch.spec.tsx.snap index db280323f..4c7d1018a 100644 --- a/packages/pluggableWidgets/intro-screen-native/src/__tests__/__snapshots__/IntroScreen.notch.spec.tsx.snap +++ b/packages/pluggableWidgets/intro-screen-native/src/__tests__/__snapshots__/IntroScreen.notch.spec.tsx.snap @@ -1,815 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Intro Screen renders 1`] = ` - - - - - - - - - - - - - - - - - - - - - - - -`; +exports[`Intro Screen renders 1`] = `null`; -exports[`Intro Screen renders with 1 bottom button 1`] = ` - - - - - - - - - - - - - - - - - - - - - - - - - - - -`; +exports[`Intro Screen renders with 1 bottom button 1`] = `null`; -exports[`Intro Screen renders with 2 bottom button 1`] = ` - - - - - - - - - - - - - - - - - - - - - - - - - - - -`; +exports[`Intro Screen renders with 2 bottom button 1`] = `null`; -exports[`Intro Screen renders with active slide attribute 1`] = ` - - - - - - - - - - - - - - - - - - - - - - - -`; +exports[`Intro Screen renders with active slide attribute 1`] = `null`; exports[`Intro Screen renders with async storage identifier 1`] = `null`; diff --git a/packages/pluggableWidgets/intro-screen-native/src/__tests__/__snapshots__/IntroScreen.spec.tsx.snap b/packages/pluggableWidgets/intro-screen-native/src/__tests__/__snapshots__/IntroScreen.spec.tsx.snap index 21123c33d..4c7d1018a 100644 --- a/packages/pluggableWidgets/intro-screen-native/src/__tests__/__snapshots__/IntroScreen.spec.tsx.snap +++ b/packages/pluggableWidgets/intro-screen-native/src/__tests__/__snapshots__/IntroScreen.spec.tsx.snap @@ -1,815 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Intro Screen renders 1`] = ` - - - - - - - - - - - - - - - - - - - - - - - -`; +exports[`Intro Screen renders 1`] = `null`; -exports[`Intro Screen renders with 1 bottom button 1`] = ` - - - - - - - - - - - - - - - - - - - - - - - - - - - -`; +exports[`Intro Screen renders with 1 bottom button 1`] = `null`; -exports[`Intro Screen renders with 2 bottom button 1`] = ` - - - - - - - - - - - - - - - - - - - - - - - - - - - -`; +exports[`Intro Screen renders with 2 bottom button 1`] = `null`; -exports[`Intro Screen renders with active slide attribute 1`] = ` - - - - - - - - - - - - - - - - - - - - - - - -`; +exports[`Intro Screen renders with active slide attribute 1`] = `null`; exports[`Intro Screen renders with async storage identifier 1`] = `null`; diff --git a/packages/pluggableWidgets/intro-screen-native/src/package.xml b/packages/pluggableWidgets/intro-screen-native/src/package.xml index 2b935564d..21fc94fce 100644 --- a/packages/pluggableWidgets/intro-screen-native/src/package.xml +++ b/packages/pluggableWidgets/intro-screen-native/src/package.xml @@ -1,6 +1,6 @@ - +