瀏覽代碼

ref(tooltbox): use componentDidUpdate to trigger more changes

master
Leonard Kim 7 年之前
父節點
當前提交
a045353e6e
共有 1 個檔案被更改,包括 5 行新增5 行删除
  1. 5
    5
      react/features/toolbox/components/web/Toolbox.js

+ 5
- 5
react/features/toolbox/components/web/Toolbox.js 查看文件

@@ -280,15 +280,15 @@ class Toolbox extends Component<Props> {
280 280
      *
281 281
      * @inheritdoc
282 282
      */
283
-    componentWillReceiveProps(nextProps) {
283
+    componentDidUpdate(prevProps) {
284 284
         // Ensure the dialog is closed when the toolbox becomes hidden.
285
-        if (this.props._overflowMenuVisible && !nextProps._visible) {
285
+        if (prevProps._overflowMenuVisible && !this.props._visible) {
286 286
             this._onSetOverflowVisible(false);
287 287
         }
288 288
 
289
-        if (this.props._overflowMenuVisible
290
-            && !this.props._dialog
291
-            && nextProps._dialog) {
289
+        if (prevProps._overflowMenuVisible
290
+            && !prevProps._dialog
291
+            && this.props._dialog) {
292 292
             this._onSetOverflowVisible(false);
293 293
             this.props.dispatch(setToolbarHovered(false));
294 294
         }

Loading…
取消
儲存