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

Better mobile device detection for interactive examples buttons #250

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

agriyakhetarpal
Copy link
Member

@agriyakhetarpal agriyakhetarpal commented Jan 10, 2025

Description

Tip

This PR builds on top of changes from #249 in order to ease merge conflicts. Please view the changes in commit f1bb4ea for a better diff in the meantime.

This PR closes #140; it moves the logic from the CSS styles for disabling the interactive buttons and uses a better heuristic via our JavaScript code; i.e., the navigator.userAgent's value to check what sort of device a user is on. As a fallback, the screen size check has also been kept. A resize handler with 250ms debouncing has also been added here to check the screen size if the buttons haven't been disabled already.

This keeps them enabled on devices like iPads and other tablets, and the CSS has been removed, as #141 (comment) is not applicable due to the use of user agents to detect the platform.

cc: @gabalafou

@agriyakhetarpal agriyakhetarpal added the enhancement New feature or request label Jan 10, 2025
@agriyakhetarpal agriyakhetarpal added this to the 0.18.0 milestone Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hide button, or warn about high data download on mobile.
1 participant