diff --git a/packages/pluggableWidgets/intro-screen-native/CHANGELOG.md b/packages/pluggableWidgets/intro-screen-native/CHANGELOG.md index a240c665f..8189bba07 100644 --- a/packages/pluggableWidgets/intro-screen-native/CHANGELOG.md +++ b/packages/pluggableWidgets/intro-screen-native/CHANGELOG.md @@ -6,6 +6,9 @@ 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-9-9 ### Fixed diff --git a/packages/pluggableWidgets/intro-screen-native/package.json b/packages/pluggableWidgets/intro-screen-native/package.json index a6dc423c8..c085ec872 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.1.0", + "version": "4.1.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 f9dfd7de1..952bbd119 100644 --- a/packages/pluggableWidgets/intro-screen-native/src/IntroScreen.tsx +++ b/packages/pluggableWidgets/intro-screen-native/src/IntroScreen.tsx @@ -1,7 +1,7 @@ import { createElement, useCallback, useEffect, useState } 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 804124a9d..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,787 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Intro Screen renders 1`] = ` - - - - , - "name": "Page 1", - }, - ] - } - extraData={0} - getItem={[Function]} - getItemCount={[Function]} - getItemLayout={[Function]} - horizontal={true} - initialScrollIndex={0} - keyExtractor={[Function]} - onContentSizeChange={[Function]} - onLayout={[Function]} - onMomentumScrollBegin={[Function]} - onMomentumScrollEnd={[Function]} - onScroll={[Function]} - onScrollBeginDrag={[Function]} - onScrollEndDrag={[Function]} - pagingEnabled={true} - removeClippedSubviews={true} - renderItem={[Function]} - scrollEventThrottle={50} - showsHorizontalScrollIndicator={false} - stickyHeaderIndices={[]} - style={ - { - "flex": 1, - "flexDirection": "row", - } - } - testID="intro-screen-notch-test" - viewabilityConfigCallbackPairs={[]} - > - - - - - - - - - - - - - - - - - - - -`; +exports[`Intro Screen renders 1`] = `null`; -exports[`Intro Screen renders with 1 bottom button 1`] = ` - - - - , - "name": "Page 1", - }, - ] - } - extraData={0} - getItem={[Function]} - getItemCount={[Function]} - getItemLayout={[Function]} - horizontal={true} - initialScrollIndex={0} - keyExtractor={[Function]} - onContentSizeChange={[Function]} - onLayout={[Function]} - onMomentumScrollBegin={[Function]} - onMomentumScrollEnd={[Function]} - onScroll={[Function]} - onScrollBeginDrag={[Function]} - onScrollEndDrag={[Function]} - pagingEnabled={true} - removeClippedSubviews={true} - renderItem={[Function]} - scrollEventThrottle={50} - showsHorizontalScrollIndicator={false} - stickyHeaderIndices={[]} - style={ - { - "flex": 1, - "flexDirection": "row", - } - } - testID="intro-screen-notch-test" - viewabilityConfigCallbackPairs={[]} - > - - - - - - - - - - - - - - - - - - - - - - - -`; +exports[`Intro Screen renders with 1 bottom button 1`] = `null`; -exports[`Intro Screen renders with 2 bottom button 1`] = ` - - - - , - "name": "Page 1", - }, - ] - } - extraData={0} - getItem={[Function]} - getItemCount={[Function]} - getItemLayout={[Function]} - horizontal={true} - initialScrollIndex={0} - keyExtractor={[Function]} - onContentSizeChange={[Function]} - onLayout={[Function]} - onMomentumScrollBegin={[Function]} - onMomentumScrollEnd={[Function]} - onScroll={[Function]} - onScrollBeginDrag={[Function]} - onScrollEndDrag={[Function]} - pagingEnabled={true} - removeClippedSubviews={true} - renderItem={[Function]} - scrollEventThrottle={50} - showsHorizontalScrollIndicator={false} - stickyHeaderIndices={[]} - style={ - { - "flex": 1, - "flexDirection": "row", - } - } - testID="intro-screen-notch-test" - viewabilityConfigCallbackPairs={[]} - > - - - - - - - - - - - - - - - - - - - - - - - -`; +exports[`Intro Screen renders with 2 bottom button 1`] = `null`; -exports[`Intro Screen renders with active slide attribute 1`] = ` - - - - , - "name": "Page 1", - }, - ] - } - extraData={0} - getItem={[Function]} - getItemCount={[Function]} - getItemLayout={[Function]} - horizontal={true} - initialScrollIndex={0} - keyExtractor={[Function]} - onContentSizeChange={[Function]} - onLayout={[Function]} - onMomentumScrollBegin={[Function]} - onMomentumScrollEnd={[Function]} - onScroll={[Function]} - onScrollBeginDrag={[Function]} - onScrollEndDrag={[Function]} - pagingEnabled={true} - removeClippedSubviews={true} - renderItem={[Function]} - scrollEventThrottle={50} - showsHorizontalScrollIndicator={false} - stickyHeaderIndices={[]} - style={ - { - "flex": 1, - "flexDirection": "row", - } - } - testID="intro-screen-notch-test" - viewabilityConfigCallbackPairs={[]} - > - - - - - - - - - - - - - - - - - - - -`; +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 4b4ae71bb..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,787 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Intro Screen renders 1`] = ` - - - - , - "name": "Page 1", - }, - ] - } - extraData={0} - getItem={[Function]} - getItemCount={[Function]} - getItemLayout={[Function]} - horizontal={true} - initialScrollIndex={0} - keyExtractor={[Function]} - onContentSizeChange={[Function]} - onLayout={[Function]} - onMomentumScrollBegin={[Function]} - onMomentumScrollEnd={[Function]} - onScroll={[Function]} - onScrollBeginDrag={[Function]} - onScrollEndDrag={[Function]} - pagingEnabled={true} - removeClippedSubviews={true} - renderItem={[Function]} - scrollEventThrottle={50} - showsHorizontalScrollIndicator={false} - stickyHeaderIndices={[]} - style={ - { - "flex": 1, - "flexDirection": "row", - } - } - testID="intro-screen-test" - viewabilityConfigCallbackPairs={[]} - > - - - - - - - - - - - - - - - - - - - -`; +exports[`Intro Screen renders 1`] = `null`; -exports[`Intro Screen renders with 1 bottom button 1`] = ` - - - - , - "name": "Page 1", - }, - ] - } - extraData={0} - getItem={[Function]} - getItemCount={[Function]} - getItemLayout={[Function]} - horizontal={true} - initialScrollIndex={0} - keyExtractor={[Function]} - onContentSizeChange={[Function]} - onLayout={[Function]} - onMomentumScrollBegin={[Function]} - onMomentumScrollEnd={[Function]} - onScroll={[Function]} - onScrollBeginDrag={[Function]} - onScrollEndDrag={[Function]} - pagingEnabled={true} - removeClippedSubviews={true} - renderItem={[Function]} - scrollEventThrottle={50} - showsHorizontalScrollIndicator={false} - stickyHeaderIndices={[]} - style={ - { - "flex": 1, - "flexDirection": "row", - } - } - testID="intro-screen-test" - viewabilityConfigCallbackPairs={[]} - > - - - - - - - - - - - - - - - - - - - - - - - -`; +exports[`Intro Screen renders with 1 bottom button 1`] = `null`; -exports[`Intro Screen renders with 2 bottom button 1`] = ` - - - - , - "name": "Page 1", - }, - ] - } - extraData={0} - getItem={[Function]} - getItemCount={[Function]} - getItemLayout={[Function]} - horizontal={true} - initialScrollIndex={0} - keyExtractor={[Function]} - onContentSizeChange={[Function]} - onLayout={[Function]} - onMomentumScrollBegin={[Function]} - onMomentumScrollEnd={[Function]} - onScroll={[Function]} - onScrollBeginDrag={[Function]} - onScrollEndDrag={[Function]} - pagingEnabled={true} - removeClippedSubviews={true} - renderItem={[Function]} - scrollEventThrottle={50} - showsHorizontalScrollIndicator={false} - stickyHeaderIndices={[]} - style={ - { - "flex": 1, - "flexDirection": "row", - } - } - testID="intro-screen-test" - viewabilityConfigCallbackPairs={[]} - > - - - - - - - - - - - - - - - - - - - - - - - -`; +exports[`Intro Screen renders with 2 bottom button 1`] = `null`; -exports[`Intro Screen renders with active slide attribute 1`] = ` - - - - , - "name": "Page 1", - }, - ] - } - extraData={0} - getItem={[Function]} - getItemCount={[Function]} - getItemLayout={[Function]} - horizontal={true} - initialScrollIndex={0} - keyExtractor={[Function]} - onContentSizeChange={[Function]} - onLayout={[Function]} - onMomentumScrollBegin={[Function]} - onMomentumScrollEnd={[Function]} - onScroll={[Function]} - onScrollBeginDrag={[Function]} - onScrollEndDrag={[Function]} - pagingEnabled={true} - removeClippedSubviews={true} - renderItem={[Function]} - scrollEventThrottle={50} - showsHorizontalScrollIndicator={false} - stickyHeaderIndices={[]} - style={ - { - "flex": 1, - "flexDirection": "row", - } - } - testID="intro-screen-test" - viewabilityConfigCallbackPairs={[]} - > - - - - - - - - - - - - - - - - - - - -`; +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 34d0ef2ea..0a38098ff 100644 --- a/packages/pluggableWidgets/intro-screen-native/src/package.xml +++ b/packages/pluggableWidgets/intro-screen-native/src/package.xml @@ -1,6 +1,6 @@ - +