Wrong return type for Window.screen
fabiospampinato opened this issue · comments
Fabio Spampinato commented
- Version: 3.0.0
- macOS: 12.5.1
Apparently it's possible for a window to be in no screen, while still not being minimized, so the return type of Window.screen
should probably be Screen | undefined
I guess.
To reproduce:
- Get the cursor close to the top edge of a window, so that the cursor turns into the vertical resize arrows.
- Drag horizontally, to initiate a drag of the window.
- Drag the window as far bottom as possible.
- If done correctly the window will be out of bounds of screen, and calling
.screen ()
on it will return youundefined
back.
I suppose a window can also be positioned out of the bounds of the screen via the APIs?
Alternatively it may be interesting if this was automatically normalized so that the closest screen were returned, if that makes sense 🤔
Kasper Hirvikoski commented
Interesting catch, thanks!