Don't disable right click globally for matplotlib figures (#1555)

Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
This commit is contained in:
Guido Zuidhof 2021-06-06 09:12:26 +01:00 committed by GitHub
parent 8932d6d938
commit 7384745fa4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -120,8 +120,6 @@ class FigureCanvasWasm(backend_agg.FigureCanvasAgg):
event.preventDefault()
return False
window.addEventListener("contextmenu", ignore)
# Create the main canvas and determine the physical to logical pixel
# ratio
canvas = document.createElement("canvas")
@ -132,6 +130,7 @@ class FigureCanvasWasm(backend_agg.FigureCanvasAgg):
width *= self._ratio
height *= self._ratio
div = self.create_root_element()
div.addEventListener("contextmenu", ignore)
div.setAttribute(
"style",
"margin: 0 auto; text-align: center;"