Skip to content

Commit

Permalink
move PortalProvider down tree slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
KenanYusuf committed May 17, 2024
1 parent 422b1db commit 7e26e9d
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 51 deletions.
36 changes: 18 additions & 18 deletions packages/victory-core/src/victory-container/victory-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,22 +149,22 @@ export const VictoryContainer = (initialProps: VictoryContainerProps) => {
}, []);

return (
<PortalProvider>
<div
className={className}
style={{
...style,
width: responsive ? style?.width : dimensions.width,
height: responsive ? style?.height : dimensions.height,
pointerEvents: "none",
touchAction: "none",
position: "relative",
}}
data-ouia-component-id={ouiaId}
data-ouia-component-type={ouiaType}
data-ouia-safe={ouiaSafe}
ref={mergeRefs([localContainerRef, containerRef])}
>
<div
className={className}
style={{
...style,
width: responsive ? style?.width : dimensions.width,
height: responsive ? style?.height : dimensions.height,
pointerEvents: "none",
touchAction: "none",
position: "relative",
}}
data-ouia-component-id={ouiaId}
data-ouia-component-type={ouiaType}
data-ouia-safe={ouiaSafe}
ref={mergeRefs([localContainerRef, containerRef])}
>
<PortalProvider>
<svg
width={width}
height={height}
Expand Down Expand Up @@ -203,8 +203,8 @@ export const VictoryContainer = (initialProps: VictoryContainerProps) => {
}}
/>
</div>
</div>
</PortalProvider>
</PortalProvider>
</div>
);
};

Expand Down
66 changes: 33 additions & 33 deletions packages/victory-native/src/components/victory-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,37 +123,37 @@ export const VictoryContainer = (initialProps: VictoryContainerNativeProps) => {
const baseStyle = NativeHelpers.getStyle(style, ["width", "height"]);

return (
<PortalProvider>
<View
{...handlers}
style={{ ...baseStyle, positition: "relative" }}
pointerEvents="box-none"
className={className}
data-ouia-component-id={ouiaId}
data-ouia-component-type={ouiaType}
data-ouia-safe={ouiaSafe}
ref={mergeRefs([localContainerRef, containerRef])}
<View
{...handlers}
style={{ ...baseStyle, positition: "relative" }}
pointerEvents="box-none"
className={className}
data-ouia-component-id={ouiaId}
data-ouia-component-type={ouiaType}
data-ouia-safe={ouiaSafe}
ref={mergeRefs([localContainerRef, containerRef])}
>
<Svg
width={width}
height={height}
aria-labelledby={ariaLabelledBy}
aria-describedby={ariaDescribedBy}
viewBox={viewBox}
preserveAspectRatio={preserveAspectRatio}
// @ts-expect-error - style prop does not seem to be recognized by react-native-svg
// preserved during refactor for compatibility, if it ever worked
style={dimensions}
accessible={ariaLabelledBy && title ? true : undefined}
accessibilityLabel={ariaLabelledBy && title ? title : undefined}
accessibilityHint={ariaDescribedBy && desc ? desc : undefined}
{...events}
{...userProps}
>
<Svg
width={width}
height={height}
aria-labelledby={ariaLabelledBy}
aria-describedby={ariaDescribedBy}
viewBox={viewBox}
preserveAspectRatio={preserveAspectRatio}
// @ts-expect-error - style prop does not seem to be recognized by react-native-svg
// preserved during refactor for compatibility, if it ever worked
style={dimensions}
accessible={ariaLabelledBy && title ? true : undefined}
accessibilityLabel={ariaLabelledBy && title ? title : undefined}
accessibilityHint={ariaDescribedBy && desc ? desc : undefined}
{...events}
{...userProps}
>
{/* The following Rect is a temporary solution until the following RNSVG issue is resolved https://github.com/react-native-svg/react-native-svg/issues/1488 */}
<Rect x={0} y={0} width={width} height={height} fill="none" />
{title ? <title id="title">{title}</title> : null}
{desc ? <desc id="desc">{desc}</desc> : null}
{/* The following Rect is a temporary solution until the following RNSVG issue is resolved https://github.com/react-native-svg/react-native-svg/issues/1488 */}
<Rect x={0} y={0} width={width} height={height} fill="none" />
{title ? <title id="title">{title}</title> : null}
{desc ? <desc id="desc">{desc}</desc> : null}
<PortalProvider>
{children}
<View
style={{
Expand All @@ -172,9 +172,9 @@ export const VictoryContainer = (initialProps: VictoryContainerNativeProps) => {
style={{ ...dimensions, overflow: "visible" }}
/>
</View>
</Svg>
</View>
</PortalProvider>
</PortalProvider>
</Svg>
</View>
);
};

Expand Down

0 comments on commit 7e26e9d

Please sign in to comment.