x-ui-design 0.9.12 → 0.9.13

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.
@@ -96,11 +96,11 @@ export const usePopupPosition = ({
96
96
  newPlacement = newPlacement.replace('top', 'bottom') as Placement;
97
97
  }
98
98
 
99
- if (availableSpace.left < 0 && availableSpace.right > 0) {
99
+ if (availableSpace.left < 0 && (availableSpace.right > 0 || availableSpace.right < popupRect.width)) {
100
100
  newPlacement = newPlacement.replace('Right', 'Left') as Placement;
101
101
  }
102
102
 
103
- if (availableSpace.right < 0 && availableSpace.left > 0) {
103
+ if (availableSpace.right < 0 && (availableSpace.left > 0 || availableSpace.left < popupRect.width)) {
104
104
  newPlacement = newPlacement.replace('Left', 'Right') as Placement;
105
105
  }
106
106
 
@@ -114,11 +114,6 @@ export const usePopupPosition = ({
114
114
  }
115
115
  }
116
116
 
117
- console.log({
118
- newPlacement,
119
- availableSpace
120
- });
121
-
122
117
  _setPlacement(newPlacement);
123
118
  }
124
119
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x-ui-design",
3
- "version": "0.9.12",
3
+ "version": "0.9.13",
4
4
  "license": "ISC",
5
5
  "author": "Gabriel Boyajyan",
6
6
  "main": "dist/index.js",
package/src/app/page.tsx CHANGED
@@ -143,15 +143,15 @@ export default function Home() {
143
143
 
144
144
 
145
145
  <div className='dsfdf' style={{ display: 'flex', width: 1200, border: '1px solid', overflow: 'scroll', height: 700 }}>
146
- <div style={{ minWidth: 1500 }} />
147
- <div style={{ height: 2000, minWidth: 1000, border: '1px solid',
146
+ <div style={{ minWidth: 100 }} />
147
+ <div style={{ height: 700, border: '1px solid',
148
148
  position: 'relative'
149
149
  }}>
150
- <div style={{ height: 1000,
150
+ <div style={{ height: 700,
151
151
  position: 'relative'
152
152
  }} />
153
153
  <Popover
154
- placement='left'
154
+ placement='bottomLeft'
155
155
  content={
156
156
  <Suspense>
157
157
  <Result