Skip to content
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

fix(useFullscreen): always listen to fullscreen change and dynamically set the initial value #1996

Merged
merged 12 commits into from Jul 12, 2023

Conversation

tmkx
Copy link
Contributor

@tmkx tmkx commented Dec 3, 2022

🤔 This is a ...

  • Bug fix

🔗 Related issue link

none

💡 Background and solution

Background:

  1. useFullscreen will have a wrong initial value when the fullscreen of element is changed by other scripts.
  2. The toggleFullscreen of useFullscreen can't work when the fullscreen of element is changed by other scripts.

Solution:

  1. Dynamically set initial value of useState
  2. always listen to fullscreen change

📝 Changelog

Language Changelog
🇺🇸 English fix(useFullscreen): always listen to fullscreen change and dynamically set the initial value
🇨🇳 Chinese fix(useFullscreen): 始终监听 change 事件并动态设置初始状态

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@CLAassistant
Copy link

CLAassistant commented Dec 3, 2022

CLA assistant check
All committers have signed the CLA.

@liuyib liuyib changed the title fix: always listen to fullscreen change fix(useFullscreen): always listen to fullscreen change Mar 11, 2023
@liuyib liuyib self-requested a review March 11, 2023 10:27
@liuyib liuyib added this to In progress in ahooks tasks via automation Mar 11, 2023
@liuyib liuyib changed the title fix(useFullscreen): always listen to fullscreen change fix(useFullscreen): always listen to fullscreen change and dynamically set the initial value Apr 9, 2023
@crazylxr crazylxr merged commit 80f7226 into alibaba:master Jul 12, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
ahooks tasks
In progress
Development

Successfully merging this pull request may close these issues.

None yet

4 participants