@gem-sdk/components 2.0.0-dev.472 → 2.0.0-dev.473

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,12 +9,15 @@ const getDisplayStyle = (device, display, position)=>{
9
9
  const style = {
10
10
  [`--top${device}`]: 'auto',
11
11
  [`--${position + device}`]: '0',
12
- [`--pos${device}`]: getCSSPosition(position)
12
+ [`--pos${device}`]: getCSSPosition(position, device)
13
13
  };
14
14
  if (display === 'after-first-cart-button') style[`--d${device}`] = 'none';
15
15
  return style;
16
16
  };
17
- const getCSSPosition = (position)=>{
17
+ const getCSSPosition = (position, device)=>{
18
+ if (device === '-mobile') {
19
+ return 'fixed';
20
+ }
18
21
  return position == 'top' ? 'sticky' : 'fixed';
19
22
  };
20
23
  const displayConditionStyle = (display, position)=>{
@@ -10,7 +10,10 @@ const useSticky = (setting)=>{
10
10
  const w = core.makeStyleResponsive('w', width);
11
11
  const sidebarMode = core.usePageStore((s)=>s.sidebarMode === 'interaction');
12
12
  const currentDevice = core.useCurrentDevice();
13
- const getCSSPosition = (position)=>{
13
+ const getCSSPosition = (position, isMobile)=>{
14
+ if (isMobile) {
15
+ return 'fixed';
16
+ }
14
17
  return position == 'top' ? 'sticky' : 'fixed';
15
18
  };
16
19
  const getCSSAlignByDevice = (position, device)=>{
@@ -59,7 +62,7 @@ const useSticky = (setting)=>{
59
62
  return {
60
63
  [`--pos`]: getCSSPosition(position?.desktop),
61
64
  [`--pos-tablet`]: getCSSPosition(position?.tablet ?? position?.desktop),
62
- [`--pos-mobile`]: getCSSPosition(position?.mobile ?? position?.desktop)
65
+ [`--pos-mobile`]: getCSSPosition(position?.mobile ?? position?.desktop, true)
63
66
  };
64
67
  }, [
65
68
  position?.desktop,
@@ -7,12 +7,15 @@ const getDisplayStyle = (device, display, position)=>{
7
7
  const style = {
8
8
  [`--top${device}`]: 'auto',
9
9
  [`--${position + device}`]: '0',
10
- [`--pos${device}`]: getCSSPosition(position)
10
+ [`--pos${device}`]: getCSSPosition(position, device)
11
11
  };
12
12
  if (display === 'after-first-cart-button') style[`--d${device}`] = 'none';
13
13
  return style;
14
14
  };
15
- const getCSSPosition = (position)=>{
15
+ const getCSSPosition = (position, device)=>{
16
+ if (device === '-mobile') {
17
+ return 'fixed';
18
+ }
16
19
  return position == 'top' ? 'sticky' : 'fixed';
17
20
  };
18
21
  const displayConditionStyle = (display, position)=>{
@@ -6,7 +6,10 @@ const useSticky = (setting)=>{
6
6
  const w = makeStyleResponsive('w', width);
7
7
  const sidebarMode = usePageStore((s)=>s.sidebarMode === 'interaction');
8
8
  const currentDevice = useCurrentDevice();
9
- const getCSSPosition = (position)=>{
9
+ const getCSSPosition = (position, isMobile)=>{
10
+ if (isMobile) {
11
+ return 'fixed';
12
+ }
10
13
  return position == 'top' ? 'sticky' : 'fixed';
11
14
  };
12
15
  const getCSSAlignByDevice = (position, device)=>{
@@ -55,7 +58,7 @@ const useSticky = (setting)=>{
55
58
  return {
56
59
  [`--pos`]: getCSSPosition(position?.desktop),
57
60
  [`--pos-tablet`]: getCSSPosition(position?.tablet ?? position?.desktop),
58
- [`--pos-mobile`]: getCSSPosition(position?.mobile ?? position?.desktop)
61
+ [`--pos-mobile`]: getCSSPosition(position?.mobile ?? position?.desktop, true)
59
62
  };
60
63
  }, [
61
64
  position?.desktop,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.472",
3
+ "version": "2.0.0-dev.473",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",