foxit-component 1.0.4-alpha.3 → 1.0.4-alpha.4
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.
- package/es/Select/Select.js +4 -1
- package/package.json +1 -1
package/es/Select/Select.js
CHANGED
|
@@ -41,7 +41,10 @@ var Select = function (_a) {
|
|
|
41
41
|
var mobileRegex = /Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i;
|
|
42
42
|
var padRegex = /iPad|Tablet|PlayBook|Silk|Kindle|Nexus 7|Nexus 10|SM-T|GT-P|TouchPad|Pad|HONOR|HDN/i;
|
|
43
43
|
var isMobile = mobileRegex.test(userAgent) || padRegex.test(userAgent);
|
|
44
|
-
|
|
44
|
+
// 解决nextjs 服务端渲染document is not defined问题
|
|
45
|
+
var menuPortalTarget = typeof document !== 'undefined' ? document.body : null;
|
|
46
|
+
// console.log(menuPortalTarget);
|
|
47
|
+
return (jsx(ReactSelect, __assign({ menuPortalTarget: menuPortalTarget, options: options, className: classNames('foxit-select-wrapper', className), placeholder: placeholder, styles: customStyles, defaultValue: isMulti
|
|
45
48
|
? options.filter(function (option) {
|
|
46
49
|
return Array.isArray(defaultValue) &&
|
|
47
50
|
defaultValue.includes(option.value);
|