diff --git a/src/lib/providers/AmbianceProvider.stories.tsx b/src/lib/providers/AmbianceProvider.stories.tsx index 8b001d91..c9538937 100644 --- a/src/lib/providers/AmbianceProvider.stories.tsx +++ b/src/lib/providers/AmbianceProvider.stories.tsx @@ -42,7 +42,19 @@ export const Sample = () => { - + + + + {(ambiance) => { + return ( + +

Elevation (forced): {ambiance.elevation}

+
+ ) + }} +
+
+
diff --git a/src/lib/providers/AmbianceProvider.tsx b/src/lib/providers/AmbianceProvider.tsx index b4cb123e..d5f01515 100644 --- a/src/lib/providers/AmbianceProvider.tsx +++ b/src/lib/providers/AmbianceProvider.tsx @@ -27,9 +27,9 @@ const Ambiance: React.FC = ({ const parent = React.useContext(AmbianceContext) const theme = useTheme() - if (!parent && !elevation) { + if (!parent && typeof elevation === 'undefined') { elevation = 0 - } else if (!elevation) { + } else if (typeof elevation === 'undefined') { elevation = parent.elevation + 1 }