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

Improve click handling on touch devices #683

Conversation

stonko1994
Copy link
Collaborator

@stonko1994 stonko1994 commented Jan 16, 2025

Description

There is an issue on touch input devices where some settings panel elements need to be touched twice in order to change them. This is due to the :hover effect which we currently use.
In addition sometimes the click event is not triggered on non button elements on touch devices in combination with our iOS Player SDK. To improve this situation I added the touchend to those elements. To keep the functionality for buttons which are inside such elemnts, we also need to add the touchend to the button component. This will be addressed in the iOS Player SDK itself.

@@ -10,7 +10,13 @@
cursor: pointer;
}

&:hover {
@media (hover: hover) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This only adds the hover style on devices where hover is supported.

@@ -102,7 +102,8 @@ export class DynamicSettingsPanelItem extends SettingsPanelItem<DynamicSettingsP
const handleItemClick = () => {
this.displayItemsSubPage();
};
this.getDomElement().on('click', (e) => {
this.getDomElement().on('click touchend', (e) => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@dweinber found an issue with this approach. The touchend triggers and opens the sub menu when releasing the touch after scrolling within the settings panel.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is fixed again by removing the touchend listeners again in: d596dbf

Note: The touchend listeners were a solution for an issue that the click event did not trigger every time on non button components. However, this was only observed in combination with the iOS Player SDK. This issue is already known and the rootcause is within the Player SDK where we call the native code from the Javascript context. This is not performant enough and blocks the Javascript execution. We will tackle this in the iOS Player SDK.

Copy link
Contributor

@bitmovin-kenny bitmovin-kenny left a comment

Choose a reason for hiding this comment

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

I guess you are missing a changelog, otherwise LGTM

Copy link
Contributor

@bitmovin-kenny bitmovin-kenny left a comment

Choose a reason for hiding this comment

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

OK since it's "only" going into the V4 branch, not to main

@stonko1994 stonko1994 merged commit e23920b into feature/modern-ui-base Jan 27, 2025
3 checks passed
@stonko1994 stonko1994 deleted the feature/improve-click-handling-on-touch-devices branch January 27, 2025 13:20
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.

2 participants