@samitouri / QOS-React-2 / commits / bf02b2ffbf

Select DOM element mode should useCapture to prevent clicks from passing through

Brian Vaughn committed Feb 27, 2019 at 13:33 UTC bf02b2ffbfe4c07c6bd610e419dcdb106978a71c
1 file changed +6 -6
src/backend/agent.js
+6 -6
@@ -177,17 +177,17 @@ export default class Agent extends EventEmitter {
177 };
178
179 startInspectingDOM = () => {
180 - window.addEventListener('click', this._onClick);
181 - window.addEventListener('mousedown', this._onMouseDown);
182 - window.addEventListener('mouseover', this._onMouseOver);
180 + window.addEventListener('click', this._onClick, true);
181 + window.addEventListener('mousedown', this._onMouseDown, true);
182 + window.addEventListener('mouseover', this._onMouseOver, true);
183 };
184
185 stopInspectingDOM = () => {
186 hideOverlay();
187
188 - window.removeEventListener('click', this._onClick);
189 - window.removeEventListener('mousedown', this._onMouseDown);
190 - window.removeEventListener('mouseover', this._onMouseOver);
188 + window.removeEventListener('click', this._onClick, true);
189 + window.removeEventListener('mousedown', this._onMouseDown, true);
190 + window.removeEventListener('mouseover', this._onMouseOver, true);
191 };
192
193 viewElementSource = ({ id, rendererID }: InspectSelectParams) => {