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

Add device emulation params for Mobile devices #31

Closed
manojVivek opened this issue Aug 27, 2019 · 7 comments · Fixed by #192
Closed

Add device emulation params for Mobile devices #31

manojVivek opened this issue Aug 27, 2019 · 7 comments · Fixed by #192
Assignees
Labels
enhancement New feature or request
Projects
Milestone

Comments

@manojVivek
Copy link
Collaborator

manojVivek commented Aug 27, 2019

Add the emulation parameters correctly for the devices with touchscreen capability to support touch events like tap, swipe etc. Right now only mouse events are supported by all devices.

@manojVivek manojVivek added the enhancement New feature or request label Aug 27, 2019
@manojVivek manojVivek added this to the MVP milestone Aug 27, 2019
@manojVivek manojVivek modified the milestones: MVP, POST MVP Sep 14, 2019
@manojVivek manojVivek removed this from the POST MVP milestone Mar 14, 2020
@romanakash
Copy link
Contributor

Apparently webview does not support device emulation electron/electron#5488.

@manojVivek
Copy link
Collaborator Author

manojVivek commented Jun 11, 2020

@romanakash I guess, it is possible by sending an Emulation command to the chromium debugger.

Can you please check this out - https://github.com/AglaiaWang/electron-quick-start/blob/master/main.js#L51 ?

@romanakash
Copy link
Contributor

I tried that out but there is a currently unresolved issue with electron which sets the parent browser window to touch mode as well. electron/electron#18438
So the whole app will have a round touch cursor instead of just the mobile device. Is this the desired behavior?

@manojVivek
Copy link
Collaborator Author

@romanakash Ah, enabling it for the whole app would make it look terrible. But I have an idea to work around this bug, let me know what do you think about the following:

  1. Let's have a button which the user can click to enable/disable the touch events.
  2. When the user enables the touch events, we will not immediately invoke the emulation command. We will just set a state variable to capture the action.
  3. We will have mouseEnter and mouseLeave listener for the .deviceContainer element and whenever the mouse enters the .deviceContainer we will invoke the emulation command and whenever it leaves we will call the command to disable the touch events.

So this way, we will achieve what the user wants.
We can add a button like in the screenshot:
device with touch icon

@romanakash Please let me know your thoughts.

@romanakash
Copy link
Contributor

Ok, that sounds good. I'll work on it

@manojVivek
Copy link
Collaborator Author

Great, @romanakash you can use this svg for the icon: https://www.dropbox.com/s/jhdffhwyfoksdsp/touch-icon.svg?dl=1

@manojVivek manojVivek added this to Accepted in App Roadmap Jun 13, 2020
@manojVivek manojVivek moved this from Accepted to In progress in App Roadmap Jun 13, 2020
@romanakash
Copy link
Contributor

romanakash commented Jun 14, 2020

Okay, I ran into some issues with this. I was able to enable the touch circle on mouse enter but the mouse leave listener doesn't fire anymore after the cursor has changed into a touch circle. So there wasn't any way of disabling the touch circle without explicitly pressing the toggle button again.

This lead to some confusion from a ux perspective as toggling the touch circle on one web view is just going to toggle the touch circle for the whole app. So I decided to move the toggle button to the scroll buttons container as shown here.

Screenshot from 2020-06-14 18-45-08

#192

@manojVivek manojVivek added this to the v0.5.0 milestone Jul 1, 2020
@manojVivek manojVivek linked a pull request Jul 1, 2020 that will close this issue
@manojVivek manojVivek moved this from In progress to Ready for Release in App Roadmap Jul 1, 2020
@manojVivek manojVivek moved this from Ready for Release to Release v0.5.0 in App Roadmap Jul 1, 2020
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
No open projects
App Roadmap
  
Release v0.5.0
Development

Successfully merging a pull request may close this issue.

2 participants