diff options
author | Eleanor Eng <eleanor_eng@brown.edu> | 2019-03-12 17:44:11 -0400 |
---|---|---|
committer | Eleanor Eng <eleanor_eng@brown.edu> | 2019-03-12 17:44:11 -0400 |
commit | 96dc0349945974a5f1c0b1329ec035dcb9dfde0e (patch) | |
tree | 2a8bae2138aa0772dd34701443d61f82855662be /src/debug/Test.tsx | |
parent | 1f038048612e01d0ada6deb9ff2a056cb8d13702 (diff) | |
parent | 618e66a5a070f1aac9224bd3f44b76a5ac314bfa (diff) |
working submenu; dimensions now relative to vw, vh
Diffstat (limited to 'src/debug/Test.tsx')
-rw-r--r-- | src/debug/Test.tsx | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/debug/Test.tsx b/src/debug/Test.tsx new file mode 100644 index 000000000..7bc70615f --- /dev/null +++ b/src/debug/Test.tsx @@ -0,0 +1,46 @@ +import * as React from 'react'; +import * as ReactDOM from 'react-dom'; + +class TestInternal extends React.Component { + onContextMenu = (e: React.MouseEvent) => { + console.log("Internal"); + e.stopPropagation(); + } + + onPointerDown = (e: React.MouseEvent) => { + console.log("pointer down") + e.preventDefault(); + } + + render() { + return <div onContextMenu={this.onContextMenu} onPointerDown={this.onPointerDown} + onPointerUp={this.onPointerDown}>Hello world</div> + } +} + +class TestChild extends React.Component { + onContextMenu = () => { + console.log("Child"); + } + + render() { + return <div onContextMenu={this.onContextMenu}><TestInternal /></div> + } +} + +class TestParent extends React.Component { + onContextMenu = () => { + console.log("Parent"); + } + + render() { + return <div onContextMenu={this.onContextMenu}><TestChild /></div> + } +} + +ReactDOM.render(( + <div style={{ position: "absolute", width: "100%", height: "100%" }}> + <TestParent /> + </div>), + document.getElementById('root') +);
\ No newline at end of file |