Disable default centering (#47) and improve typings#48
Open
andrewsantarin wants to merge 1 commit intormariuzzo:mainfrom
Open
Disable default centering (#47) and improve typings#48andrewsantarin wants to merge 1 commit intormariuzzo:mainfrom
andrewsantarin wants to merge 1 commit intormariuzzo:mainfrom
Conversation
rmariuzzo
reviewed
Nov 27, 2022
| onBlock: null, | ||
| onOpen: null, | ||
| onUnload: null, | ||
| center: 'parent', |
rmariuzzo
reviewed
Nov 27, 2022
| if (typeof center === 'string') { | ||
| if (features.width == null || features.height == null) { | ||
| console.warn( | ||
| 'react-new-window: "width" and "height" window features must be present when a center prop is provided.' |
rmariuzzo
reviewed
Nov 27, 2022
Comment on lines
+16
to
+23
| left: number | ||
| top: number | ||
| menubar: boolean | ||
| toolbar: boolean | ||
| scrollbars: boolean | ||
| location: boolean | ||
| status: boolean | ||
| resizable: boolean |
Owner
There was a problem hiding this comment.
It seems valid window feature are limited to: popup, width, height, left, top, noopener and noreferrer. The others are no longer working in modern browser.
rmariuzzo
reviewed
Nov 27, 2022
Owner
rmariuzzo
left a comment
There was a problem hiding this comment.
It looks pretty good. I will merge and test locally and decide for a release.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
So, learning that #47 is easily overcome with
center={false}(I really, really thought thatreact-new-windowis hardcoded to use some kind of centering), I wanted to improve the quality of life a bit by making centerundefinedat the start.Also, I've added additional attribs to the
IWindowFeaturesinterface so that it's clear what attributes go to thefeaturesprop. Referenced fromreact-popout-component, figured theinterfacecould be useful since that library hasn't seen new merged commits in almost a year...Feel free to roast my commit if it means writing even better code. :)