Skip to content

Commit

Permalink
add code to upgrade Electron to adapt to event.path.
Browse files Browse the repository at this point in the history
  • Loading branch information
knoxHuang committed Oct 18, 2024
1 parent b34203f commit d568c48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions editor/inspector/assets/material.js
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,10 @@ exports.ready = function() {
this.$.materialDump.addEventListener('change-dump', async (event) => {
const dump = event.target.dump;

if (!event.path) {
event.path = event.composedPath();
}

let passIndex = 0;
for (let element of event.path) {
if (element instanceof HTMLElement && element.hasAttribute('pass-index')) {
Expand Down
5 changes: 5 additions & 0 deletions editor/inspector/components/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,11 @@ exports.methods = {
},

select(event) {

if (!event.path) {
event.path = event.composedPath();
}

// Handling through delegated events
const button = event.path.find((element) => element && element.classList && element.classList.contains('button'));

Expand Down

0 comments on commit d568c48

Please sign in to comment.