Disable ContextMenu

release
mashirozx 2021-10-26 14:40:45 +08:00
parent 7edf171664
commit 818aba94a0
3 changed files with 9 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "emoji-mart-lazyload",
"version": "3.0.1h",
"version": "3.0.1i",
"description": "Customizable Slack-like emoji picker for React",
"main": "dist/index.js",
"module": "dist-es/index.js",

View File

@ -34,11 +34,11 @@ export default class Category extends React.Component {
this.memoizeSize()
this.lazyloadImages = []
this.lazyload()
this.addLazyloadObserver()
}
componentDidUpdate() {
this.lazyload()
this.addLazyloadObserver()
}
componentWillUnmount() {
@ -108,7 +108,7 @@ export default class Category extends React.Component {
}
}
lazyload() {
addLazyloadObserver() {
this.removeLazyloadObserver()
this.lazyloadImages = this.container.querySelectorAll(".lazy");
@ -123,6 +123,10 @@ export default class Category extends React.Component {
})
}
handleOnContextMenu(e) {
e.preventDefault();
}
handleScroll(scrollTop) {
var margin = scrollTop - this.top
margin = margin < this.minMargin ? this.minMargin : margin

View File

@ -209,6 +209,7 @@ const NimbleEmoji = (props) => {
onClick={(e) => _handleClick(e, props)}
onMouseEnter={(e) => _handleOver(e, props)}
onMouseLeave={(e) => _handleLeave(e, props)}
onContextMenu={(e) => e.preventDefault()}
aria-label={label}
title={title}
className={className}