Skip to content

Commit

Permalink
fix: 修复Layout/Sider组件safari下响应式报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
hangaoke1 committed May 8, 2020
1 parent 50a5bc2 commit 4d082db
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions site/docs/upgradeNotes/1.7/1.7.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@
### 1.7.4-beta.1
- Notification
- 🔨 优化 API onClose,新增参数 key 区分手动和自动关闭

### 1.7.4-beta.2
- Layout
- 🐛 修复 Safari下 Sider组件监听事件报错
4 changes: 4 additions & 0 deletions site/docs/upgradeNotes/版本升级说明.md
Original file line number Diff line number Diff line change
Expand Up @@ -970,3 +970,7 @@
## 1.7.4-beta.1
- Notification
- 🔨 优化 API onClose,新增参数 key 区分手动和自动关闭

## 1.7.4-beta.2
- Layout
- 🐛 修复 Safari下 Sider组件监听事件报错
3 changes: 2 additions & 1 deletion source/components/Layout/Sider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ class Sider extends React.Component<SiderProps, SiderState> {

componentDidMount() {
if (this.mql) {
this.mql.addEventListener('change', this.responsiveHandler);
// this.mql.addEventListener('change', this.responsiveHandler);
this.mql.addListener(this.responsiveHandler);
this.responsiveHandler((this.mql as any) as MediaQueryListEvent);
}

Expand Down

0 comments on commit 4d082db

Please sign in to comment.