Ideally, child of a container is above its parent(container), therefore it will catch the input event.
In your case, the input event are registered in child(goBtn) and, its parent-parent’s(layer), finally p3 engine ran to unknown result, .i.e. these code could not handle your case correctly. It is a p3 engine’s bug.
I could try to send a PR to solve it.
From the name of these two containers: dialog and layer. It seems that you are trying to build some ui components placed on a layer. Here is a plugin for ui components. What kind of features would you expect for a layer object?
I’m going to scroll in the UI component, drag the content to scroll, and the content to scroll has buttons in it that can trigger events.(我要在UI组件里做滚动,拖动内容可以滚动,并且滚动的内容里还有按钮,按钮可以触发事件。)
Here is a demo of scrollable panel, with clickable (pointerdown event, line 228-233) button.
Reference document: Scrollable panel, Grid sizer, and Label.
I need to import the rexuiplugin.min.js (320kb) plugin to use this feature. Can you provide a separate plug-in to package the Scrollable panel function?(我要用这个功能需要引入rexuiplugin.min.js(320kb)插件太大了。可否提供单独打包‘Scrollable panel ’功能的插件?)
Copy folder plugins and templates into your project, then import required class like ScrollablePanel.js directly.
In this solution, you will use ui object class directly, instead of create ui object via creater methods. BTW, my ui object class is in ES6 style.
By that I mean you can use this module to provide on-demand import functionality when you install it through the “NPM install phaser3-rex-notes”. Instead of copying your project to mine.(我的意思是通过“npm install phaser3-rex-notes”安装您这个模块使用的时候可以提供按需引入功能。而不是把您的项目拷贝到我的项目。)
Once you add phaser3-rex-plugins into dependencies of package.json and install it. UI plugins will be put at ‘phaser3-rex-plugins/templates/ui/’. Import scrollable class via
import ScrollablePanel from 'phaser3-rex-plugins/templates/ui/scrollablepanel/ScrollablePanel.js';
I use that dependencies to update my plugins, but this solution might not get latest version immediately after I updated plugins repo (fix a bug or add some features).
That why I suggest that coping repo directly instead of install repo by npm.