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

If I touch and hold toast, it never hides #299

Open
calintamas opened this issue Dec 19, 2021 · 14 comments
Open

If I touch and hold toast, it never hides #299

calintamas opened this issue Dec 19, 2021 · 14 comments
Labels
investigate Look into the issue

Comments

@calintamas
Copy link
Owner

Not sure if it is intentional behavior, but if I touch and hold toast, it never hides (autoHide is set to true). The hiding animation takes place, but toast stays on screen infinitely. You may need to pull your finger down a bit after the hiding animation is complete in order to display toast again. I get this behavior on iOS as well as Android. Package version: 2.1.0

Originally posted by @danieldaukapp in #280 (comment)

@calintamas calintamas added the investigate Look into the issue label Dec 19, 2021
@dev-babar
Copy link

Yeah, also facing the same issue, touch and swipe lil bit down and hold then release, it never hides. And if you hold longer it hide and reappear when release the touch.

@pankaj-k-simformsolutions

@calintamas any update on this

@doougui
Copy link

doougui commented Apr 1, 2022

Facing the same issue here.

@sushantWemotive
Copy link

same issue here

@mrshahzeb7
Copy link

any solution ?

@mrshahzeb7
Copy link

mrshahzeb7 commented Apr 29, 2022

used this logic
it is working for me

const {isVisible} = props;

const [isVisibleToast, setisVisibleToast] = useState(false);

useEffect(() => {
if (isVisible) {
setisVisibleToast(true);
} else {
setTimeout(() => {
setisVisibleToast(false);
}, 2000);
}
}, [isVisible]);

return isVisibleToast ? (

{
//custom Toast
}
)
:
null

@LukasMod
Copy link

Same issue here, toasts won't hide. I would say it's critical bug.

@oakmegaeddie
Copy link

I guess the reason is that after visibilityTime, the toast is still being pressed, so it can't hide after release.
The solution to fix this bug in the library code would be check whether it should hide or not after release.

@KoenVerhulst
Copy link

Any plans in fixing this?

@knightmate
Copy link

@calintamas Hi, do you have any updates on this? I've also encountered this bug on Android. Should I address it?

@mleister97
Copy link

The issue persists in 2024...

@ianvasco
Copy link

ianvasco commented Feb 22, 2024

Just applied a patch from my side that will prevent the 2nd non-closable toast message from being there. We'll be running some QA testing to check if it doesn't affect other features and then I can consider creating a Pull Request to fix that issue!

EDIT

Solution has been problematic when running QA regressions, I'll update a workaround here when finding an stable solution.

@pepperinpeppermint314159
Copy link

pepperinpeppermint314159 commented Apr 3, 2024

node_modules/react-native-toast-message/lib/src/components/AnimatedContainer.d.ts
in function: animatedValueFor

add this:

    const { dy, numberActiveTouches } = gesture;  // use numberActiveTouches

    switch (position) {
        case 'bottom':
            if (!numberActiveTouches) return boundValue(0) // add this
            return boundValue(1 - dy / damping);
        case 'top':
            if (!numberActiveTouches) return boundValue(0) // add this
            return boundValue(1 + dy / damping);
        default:
            throw new Error(`Toast position: ${position} not implemented`);
    }

@Meet-Kapadiya
Copy link

Meet-Kapadiya commented Jul 23, 2024

Still it recreates a new instance

media_20240723_101907_3362853197575039291.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Look into the issue
Projects
None yet
Development

No branches or pull requests