Skip to content

[bugfix] Update storybook and samples to disable mobile feature "pull-down to refresh"#2619

Merged
edwardlee-msft merged 4 commits intomainfrom
elee/disable-pulldown-to-refresh
Jan 3, 2023
Merged

[bugfix] Update storybook and samples to disable mobile feature "pull-down to refresh"#2619
edwardlee-msft merged 4 commits intomainfrom
elee/disable-pulldown-to-refresh

Conversation

@edwardlee-msft
Copy link
Copy Markdown
Contributor

What

Disable pull-down to refresh on samples and document best practice in storybook on how to handle accidental pull down to refresh triggers on mobile

Why

On IOS Safari Chat and CallWithChat scrolling on chat page can sometimes cause the whole page view to refresh/scroll.
This can cause accidental page refresh.
https://skype.visualstudio.com/SPOOL/_workitems/edit/3069029

How Tested

Tested on iPhone SE on CallWIthChat and Chat sample.

Process & policy checklist

  • I have updated the project documentation to reflect my changes if necessary.
  • I have read the CONTRIBUTING documentation.

Is this a breaking change?

  • This change causes current functionality to break.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 30, 2022

CallWithChat bundle size is increased❗.

  • Current size: 5875980
  • Base size: 5875867
  • Diff size: 113

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 30, 2022

Chat bundle size is increased❗.

  • Current size: 5582294
  • Base size: 5582182
  • Diff size: 112

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 30, 2022

Calling bundle size is decreased✅.

  • Current size: 5491064
  • Base size: 5491065
  • Diff size: -1

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

// Disables pull down to refresh. Prevents accidental page refresh when scrolling through chat messages
// Another alternative: set body style touch-action to 'none'. Achieves same result.
useEffect(() => {
document.body.style.overflow = 'hidden';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this disable pulldown behavior because there is no overflow on the page?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, essentially on safari ios there is no explicit option to disable pull down to refresh.
The intermediate solution is to either apply a
overflow: 'hidden' or a touch-action: 'hidden' to the body element to prevent a pull-down from occurring at all.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not apply this fix to the composites and have only applied the fix to the samples as this can 100% affect Contosos use cases if integrated as a modal, iframe, etc..

I added instructions into storybook for best practices for mobile.

@edwardlee-msft edwardlee-msft merged commit d7d036e into main Jan 3, 2023
@edwardlee-msft edwardlee-msft deleted the elee/disable-pulldown-to-refresh branch January 3, 2023 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants