Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangePicker在IE 10中点击会报错 #14405

Closed
1 task done
tonypig93 opened this issue Jan 17, 2019 · 19 comments
Closed
1 task done

RangePicker在IE 10中点击会报错 #14405

tonypig93 opened this issue Jan 17, 2019 · 19 comments
Assignees
Labels
🤔 Need Reproduce We cannot reproduce your problem

Comments

@tonypig93
Copy link

tonypig93 commented Jan 17, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.

Steps to reproduce

点击RangePicker

What is expected?

不会报错

What is actually happening?

控制台报错:对象不支持“getDerivedStateFromProps”属性或方法

Environment Info
antd 3.12.3
React 16.6.3
System windows 10
Browser IE 10

没办法在IE 10中打开codesandbox

@afc163
Copy link
Member

afc163 commented Jan 17, 2019

Seems react-component/calendar@ee24ca5 caused it.

@zombieJ
Copy link
Member

zombieJ commented Jan 18, 2019

给个 github 地址重现看一下,我这边好的:
kapture 2019-01-18 at 10 26 39

@zombieJ zombieJ added the 🤔 Need Reproduce We cannot reproduce your problem label Jan 18, 2019
@ant-design-bot
Copy link
Contributor

Hello @tonypig93. Please provide a online reproduction by forking this link https://u.ant.design/codesandbox-repro or a minimal GitHub repository. Issues labeled by Need Reproduce will be closed if no activities in 7 days.

你好 @tonypig93, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 此处 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。7 天内未跟进的 issue 将会被自动关闭。

@tonypig93
Copy link
Author

给个 github 地址重现看一下,我这边好的:
kapture 2019-01-18 at 10 26 39

我用win10 的IE,开启IE10的文档模式,打开antd官网点击datepick就会报错
2da9bea7-d3e1-43fa-96ac-3d04bc20fb2e

@zombieJ
Copy link
Member

zombieJ commented Jan 18, 2019

我用win10 的IE,开启IE10的文档模式,打开antd官网点击datepick就会报错

官方文档没有对旧版 IE 做 polyfill,自己项目开发的时候开启 polyfill 就行了。如果用的是 umi,可以直接配置目标游览器版本:https://umijs.org/zh/config/#targets

@tonypig93
Copy link
Author

我用win10 的IE,开启IE10的文档模式,打开antd官网点击datepick就会报错

官方文档没有对旧版 IE 做 polyfill,自己项目开发的时候开启 polyfill 就行了。如果用的是 umi,可以直接配置目标游览器版本:https://umijs.org/zh/config/#targets

我在项目已经引用了babel-polyfill,然后用IE 10的文档模式打开依然会报上面的错。不太清楚还需要开启什么polyfill。

@zombieJ
Copy link
Member

zombieJ commented Jan 18, 2019

这个有开过吗?https://babeljs.io/docs/en/babel-preset-env#targets

@tonypig93
Copy link
Author

这个有开过吗?https://babeljs.io/docs/en/babel-preset-env#targets

开过了

"browserslist": [
    "defaults",
    "ie 9-11"
  ]

@Tulipxu
Copy link

Tulipxu commented Jan 18, 2019

我的在ie9下也是报这个错,开启了polyfill,还是不行,请问还需要配置什么东西吗?

@zombieJ
Copy link
Member

zombieJ commented Jan 18, 2019

我看看我能不能在 rc 里把 polyfill 做掉,晚些时候会发个 rc-calendar 的 patch。

zombieJ added a commit to react-component/calendar that referenced this issue Jan 18, 2019
@zombieJ
Copy link
Member

zombieJ commented Jan 18, 2019

@tonypig93 @Tulipxu ,发了 rc-calendar@9.10.7。把 node_modules 删了重装一下,试试看。

@tonypig93
Copy link
Author

@zombieJ 重装node_modulesrc-calendar还是9.10.5,手动把9.10.7拷贝到node_modules后,控制台报错
image
image

@afc163
Copy link
Member

afc163 commented Jan 18, 2019

删除 package-lock.json 或者 yarn.lock 后重装。

@tonypig93
Copy link
Author

tonypig93 commented Jan 18, 2019

删了lock文件后重装了,版本对了但是还是会报上面的错误,具体应该是RangePicker会报错。

@tonypig93 tonypig93 changed the title DatePicker在IE 10中点击会报错 RangePicker在IE 10中点击会报错 Jan 18, 2019
@tonypig93
Copy link
Author

@zombieJ @afc163 我用create-react-app重启开了一个项目来测试,只引用了RangePicker,然后在IE 10下点击就会报错,不好意思之前以为是DatePicker

@afc163
Copy link
Member

afc163 commented Jan 18, 2019

可以提供下重现仓库。

@tonypig93
Copy link
Author

可以提供下重现仓库。

https://github.com/tonypig93/antd-demo

zombieJ added a commit to react-component/calendar that referenced this issue Jan 21, 2019
@zombieJ
Copy link
Member

zombieJ commented Jan 21, 2019

@zombieJ @afc163 我用create-react-app重启开了一个项目来测试,只引用了RangePicker,然后在IE 10下点击就会报错,不好意思之前以为是DatePicker

DatePicker 的确是有问题的,看来 RangePicker 也有。我发了 rc-calendar@9.10.8 你再试试。

@tonypig93
Copy link
Author

@zombieJ @afc163 我用create-react-app重启开了一个项目来测试,只引用了RangePicker,然后在IE 10下点击就会报错,不好意思之前以为是DatePicker

DatePicker 的确是有问题的,看来 RangePicker 也有。我发了 rc-calendar@9.10.8 你再试试。

可以了,谢谢

Cheetah0723 added a commit to Cheetah0723/Calendar that referenced this issue Nov 7, 2021
Cheetah0723 added a commit to Cheetah0723/Calendar that referenced this issue Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤔 Need Reproduce We cannot reproduce your problem
Projects
None yet
Development

No branches or pull requests

6 participants