@canlooks/can-ui 0.0.183 → 0.0.184

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.
@@ -145,8 +145,13 @@ function useContainer(container, effectContainer, defaultContainer) {
145
145
  if (container) {
146
146
  return typeof container === 'function' ? container() : container;
147
147
  }
148
- if (!prev && typeof document !== 'undefined') {
149
- return document.body;
148
+ if (!prev) {
149
+ if (typeof defaultContainer !== 'undefined') {
150
+ return typeof defaultContainer === 'function' ? defaultContainer() : defaultContainer;
151
+ }
152
+ if (typeof document !== 'undefined') {
153
+ return document.body;
154
+ }
150
155
  }
151
156
  return prev;
152
157
  }, [container]);
@@ -130,8 +130,13 @@ export function useContainer(container, effectContainer, defaultContainer) {
130
130
  if (container) {
131
131
  return typeof container === 'function' ? container() : container;
132
132
  }
133
- if (!prev && typeof document !== 'undefined') {
134
- return document.body;
133
+ if (!prev) {
134
+ if (typeof defaultContainer !== 'undefined') {
135
+ return typeof defaultContainer === 'function' ? defaultContainer() : defaultContainer;
136
+ }
137
+ if (typeof document !== 'undefined') {
138
+ return document.body;
139
+ }
135
140
  }
136
141
  return prev;
137
142
  }, [container]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canlooks/can-ui",
3
- "version": "0.0.183",
3
+ "version": "0.0.184",
4
4
  "author": "C.CanLiang <canlooks@gmail.com>",
5
5
  "description": "My ui framework",
6
6
  "license": "MIT",