Popper-core: TypeError: Failed to execute'getComputedStyle'on'Window': parameter 1 is parameter

Created on 10 Aug 2018  Â·  7Comments  Â·  Source: popperjs/popper-core

CodePen demo

https://codepen.io/pen?template=wGqJEz

Steps to reproduce the problem

  1. electron-nuxt-element.zip
  2. element-ui-issues
  3. Installation
wget https://github.com/ElemeFE/element/files/2234482/electron-nuxt-element.zip
unzip electron-nuxt-element.zip
cd electron-nuxt-element
npm i
npm run dev

What is the expected behavior?

Can window.getComputedStyle be changed to element.getRootNode().defaultView.getComputedStyle

What went wrong?

Document element will be wrong when used in different windows

Any other comments?

Window uses element.getRootNode().defaultView,
I also expect that not all popup layers are inserted into the root body, but there is an optional insertion point.

bug-demo

# ENHANCEMENT ✨ low low core

Most helpful comment

Feel free to send a PR with a fix please.

All 7 comments

ddv-multi-window is a multi-tab application for sub-windows across windows. It can be used. The current problem seems to be in the sub-window, dom is in the sub-window, the event is in the main window, but in the element-ui in the main window, the sub-window is found. Dom
Preliminary estimates are issues with the isFixed and getStyleComputedProperty methods

I mainly use element-ui in electron, but element-ui-issues-12135 decided to use popper.js. Currently my application is based on nuxt. This problem is estimated by the isFixed and getStyleComputedProperty and getComputedStyle methods of @yeziZ. The problem is that you need to support various pull-down or floating windows without relative roots. You can support the input of an inserted node. In addition, the window.getComputedStyle method needs to be changed to element.getRootNode().defaultView.getComputedStyle. The actual application scenario is @yuchonghua. In electron-nuxt-element.

Feel free to send a PR with a fix please.

I will study how to fix it, give me some time, thank you for your support.

Is pr a master branch operation or a next branch operation?
/ping @FezVrasta

Please work on master, next is a different project

I simply did a mobile div test and found that ddv-multi-window and popper.js are normal. I temporarily close #issues-665 and do a further test element-ui-vue-popper
Thanks to FezVrasta, I am bothering you, sorry.


nuxt-popper-simplify.zip


wget https://github.com/FezVrasta/popper.js/files/2279931/nuxt-popper-simplify.zip
unzip nuxt-popper-simplify.zip
cd nuxt-popper-simplify
npm i
npm run dev


run-demo


run-demo

/ping @jikkai @ziyoung

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kerf007 picture kerf007  Â·  3Comments

ConneXNL picture ConneXNL  Â·  3Comments

skitterm picture skitterm  Â·  5Comments

Sawtaytoes picture Sawtaytoes  Â·  5Comments

Leopoldthecoder picture Leopoldthecoder  Â·  6Comments