GithubHelp home page GithubHelp logo

Comments (17)

CodeXiD avatar CodeXiD commented on September 23, 2024 4

same problem, any news on this issue?

Not really. I did a workaround

Share your solution?

from react-modal-sheet.

mirandanc avatar mirandanc commented on September 23, 2024 2

Still having the same problem.

from react-modal-sheet.

BetBit avatar BetBit commented on September 23, 2024 2

Hello!
This issue is only related to Android; everything works correctly on iOS.

from react-modal-sheet.

gremcha avatar gremcha commented on September 23, 2024 1

Hello @Temzasse

I've also encountered this issue. Your demonstrative example doesn't work on Android mobile devices. I tested it on Chrome and Firefox browsers.

I can also reproduce this problem on a computer in the Chrome browser. Under normal conditions, the modal window behaves correctly, but when I switch to a mobile device, it stops closing.

2024-05-17 13-07-47

from react-modal-sheet.

CodeXiD avatar CodeXiD commented on September 23, 2024

same problem, any news on this issue?

from react-modal-sheet.

CodeXiD avatar CodeXiD commented on September 23, 2024

Hello everyone, I encountered the same problem, in my case I removed the Header, and wanted to make my own, but on mobile I encountered a problem that the panel did not collapse, but only jumped slightly from top to bottom. The solution turned out to be quite simple, I added the draggable={false} attribute to my own Header (which is not located at the top of the hierarchy), and everything began to work as expected

from react-modal-sheet.

Knaackee avatar Knaackee commented on September 23, 2024

same problem, any news on this issue?

Not really. I did a workaround

from react-modal-sheet.

Temzasse avatar Temzasse commented on September 23, 2024

Hi @Knaackee 👋

The Scroller component works so that it enables the drag gestures only when the scroller is either at the top or at the bottom. If the user is scrolling the content the sheet body is not draggable as there is really no way to distinguish between scrolling and dragging.

Is the problem that the sheet is not draggable at the top/bottom positions? That would be a bug.

Does this example demo work for you? At least on my iPhone it works nicely: sheet is dragged down from body area when the sheet is not scrolled and when the sheet scroller is scrolled all the way to bottom the sheet can be dragged upwards.

from react-modal-sheet.

laem avatar laem commented on September 23, 2024

Same here. More precisely, on android :

  • with draggable=both, on Firefox, when the content is not high enough to require scroll, the drag action closes the modal. But does not close when the content requires scroll
  • on chromium (bromite, kiwi), it can never be closed with a scroll

from react-modal-sheet.

laem avatar laem commented on September 23, 2024

Would gladly help, but I'm a bit lost, the code is more complicated than I thought :)

from react-modal-sheet.

laem avatar laem commented on September 23, 2024

Mmmh, found something interesting ! On chrome mobile (well at least Bromite and Kiwi), drag works... with two fingers !

On chromium desktop in mobile dev mode, shift + drag works too (simulates two fingers).

Can also confirm that using two fingers solves the problem for firefox when content height -> scroll.

with draggable=both, on Firefox, when the content is not high enough to require scroll, the drag action closes the modal. But does not close when the content requires scroll

from react-modal-sheet.

laem avatar laem commented on September 23, 2024

First I tried to resolve this by setting "overflow:hidden" when the user started to drag. But it doesn't work.

Now trying to use the "touch-action" css prop thanks to this issue and getting interesting results, though not good enough yet. I'm trying things on the lib locally in my repo laem/cartes@a0e2377

from react-modal-sheet.

laem avatar laem commented on September 23, 2024

Unfortunately, firefox and safari do not support "pan-down"...

Edit : I implemented a small hook to detect the direction of the pan.

from react-modal-sheet.

joaolfern avatar joaolfern commented on September 23, 2024

It's not ideial but I'm using this to prevent the page from refreshing:

useLayoutEffect(() => {
  if (isOpen) document.querySelector('body')!.style.overscrollBehavior = 'none'

  return () => {
    document.querySelector('body')!.style.overscrollBehavior = 'unset'
  }
}, [isOpen])

I think it will still take a moment for users to figure out how to close it, but I also have snapPoints={[0.85]} so there's a nice inviting touchable area.

from react-modal-sheet.

robertpiosik avatar robertpiosik commented on September 23, 2024

Hi, from what I tested https://github.com/emilkowalski/vaul tackles this behavior on chrome correctly, maybe we could get some inspiration from them.

from react-modal-sheet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.