@@ -33,19 +33,6 @@ export class ToolBox extends React.PureComponent<Props, State>{
3333 */
3434 private actionContainerDOM : HTMLElement = null
3535
36- componentWillMount ( ) {
37- // 在 body 下创建一个放置 debug-box 的节点
38- const debugContainer = document . createElement ( "div" )
39- debugContainer . id = debugContainerId
40- debugContainer . style . position = 'absolute'
41- debugContainer . style . top = '0px'
42- debugContainer . style . right = '0px'
43- debugContainer . style . bottom = '0px'
44- debugContainer . style . left = '0px'
45- debugContainer . style . pointerEvents = 'none'
46- document . querySelector ( 'body' ) . appendChild ( debugContainer )
47- }
48-
4936 getChildContext ( ) {
5037 return {
5138 dyDebug : this . context . dyDebug
@@ -61,6 +48,18 @@ export class ToolBox extends React.PureComponent<Props, State>{
6148 } )
6249
6350 this . context . dyDebug . event . on ( 'focusActionDetail' , this . handleFocusActionDetail )
51+
52+ // 在 body 下创建一个放置 debug-box 的节点
53+ const debugContainer = document . createElement ( "div" )
54+ debugContainer . id = debugContainerId
55+ debugContainer . style . position = 'fixed'
56+ debugContainer . style . top = '0px'
57+ debugContainer . style . right = '0px'
58+ debugContainer . style . bottom = '0px'
59+ debugContainer . style . left = '0px'
60+ debugContainer . style . pointerEvents = 'none'
61+ debugContainer . style . overflow = 'hidden'
62+ ReactDOM . findDOMNode ( this ) . appendChild ( debugContainer )
6463 }
6564
6665 public componentWillUnmount ( ) {
0 commit comments