New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
useWindowSize
Resize detection on mobile devices
#1505
Comments
Could you combine with e.g. import { watch } from 'vue'
import { useWindowSize, useScreenOrientation } from '@vueuse/core'
const { height } = useWindowSize()
const { orientation } = useScreenOrientation()
watch([height, orientation], () => {
if (window) console.log(window.innerHeight)
}) |
@JMaylor However, I am concerned that the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I'm running into this. These are outputting different amounts: watch(orientation, () => {
console.log("width: ", windowWidth.value, "height: ", windowHeight.value);
});
watch(windowWidth, () => {
console.log(
"windowWidth: ",
windowWidth.value,
"height: ",
windowHeight.value,
);
}); |
Describe the bug
Prerequisite :
In index.html
Set and "Add to Home" state.
Issue
I used useWindowSize for reactive window size detection.
I used useWindowSize to detect not only the
resize
event, but also theI think we should add an
orientationchange
event as well, since it is possible to detect changes by binding anorientationchange
event as well.I'm not sure I've covered all the features of Vueuse, so if there is another way to do it, I'd appreciate it if you could let me know.
Reproduction
none
System Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: