Skip to content

Conversation

@leonvogt
Copy link
Contributor

@leonvogt leonvogt commented Feb 16, 2025

This PR introduces a way to prevent the pull to refresh behavior on specific elements.
When an element (or its ancestor) has data-hotwire-native-prevent-pull-to-refresh attribute, pull to refresh is disabled.
When an element (or its ancestor) has data-native-prevent-pull-to-refresh attribute, pull to refresh is disabled.

All the examples shown in #97 could be solved by adding the data attribute to the respective elements.

This introduces a difference from Hotwire Native iOS, since iOS doesn't need this attribute, which isn't ideal.
But I currently don't see a better solution. Happy to discuss this further and maybe find a better solution.

@leonvogt leonvogt force-pushed the add-prevent-pull-to-refresh branch from aed61f8 to 7c2afbf Compare February 22, 2025 16:14
@jayohms
Copy link
Contributor

jayohms commented Feb 22, 2025

Fyi @leonvogt I've added site reference documentation here: hotwired/hotwire-native-site#74

@leonvogt
Copy link
Contributor Author

Awesome, thank you @jayohms! 🎉

@jayohms jayohms merged commit b6b375d into hotwired:main Feb 22, 2025
@leonvogt leonvogt deleted the add-prevent-pull-to-refresh branch February 22, 2025 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants