Dynamic styles get created in a parent window instead of a popup window
See original GitHub issueSeeing glitchy UI:
When opening the dropdown:
When right-clicking:
I have this component in both a normal browser window and a popout window (created through react-new-window
which basically does window.open
). The glitch happens only in the popout. Only in Firefox.
Moreover this happens only the first time I open the popout after a page refresh and not on subsequent popouts.
Here’s my usage of the component:
const LOG_TYPES = {
APP: {label: 'Application Logs', value: 'app'},
FAILED: {label: 'Failure Logs', value: 'failed'},
};
<ReactSelect
isClearable={false}
isSearchable={false}
width="180px"
value={this.state.logType}
placeholder="Log type"
onChange={this.selectLogType}
options={Object.values(LOG_TYPES)}
/>
react-select
version - 3.0.8
It’s very tricky to debug this, since Firefox refuses to pause the code in a popout, so I can’t inspect the DOM when the dropdown is open. console.log
doesn’t seem to happen either.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Styled-components dynamic CSS is not generated in a new ...
So I see two possible ways I could solve it: I could tell styled-component to somehow talk to the new window, not the...
Read more >Popups and window methods - The Modern JavaScript Tutorial
The syntax to open a popup is: window.open(url, name, params) : url: An URL to load into the new window. name: A name...
Read more >Creating Open Window actions for Popup window
The Popup Open Window action prompts for user input and transfers the data entered to the parent form. The Popup type provides an...
Read more >How to dynamic set width for popup from current parent view
Hello. After tunning detail view in Model editor i see diffrence sizes in web for each cases. I want to have equal sizes...
Read more >Window Features - Win32 apps | Microsoft Learn
Use the WS_POPUPWINDOW style to create a pop-up window that has a ... that would have gone to the child window to the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@dmt0 Could you provide a minimal reproducible example with the usage of
react-new-window
using CodeSandbox?Greetings @dmt0
I am not sure if it helps any, or how you would work with
react-new-window
, but first guess would be to try something onMount to copy the styles to the new popup.copyStyles
prop in yourreact-new-window
?If that isn’t working then you may need to inject the styles that Emotion generates manually as seen here:![Screen Shot 2020-12-04 at 10 38 24 AM](https://user-images.githubusercontent.com/1007579/101204344-ed1ebc80-3620-11eb-84ab-267f312675c4.png)
LocalStorage is shared between windows and tabs so that might be a good storage mechanism.
Very interested to see how this gets resolved for you.