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

Interaction is slow on mobile #10

Closed
benjamind opened this issue Nov 17, 2018 · 6 comments
Closed

Interaction is slow on mobile #10

benjamind opened this issue Nov 17, 2018 · 6 comments
Labels
documentation Because documentation is important and shouldn't be broken

Comments

@benjamind
Copy link
Contributor

Expected Behavior

Hover and down/up interactions should be fast and snappy.

Actual Behavior

When tapping buttons or any element which causes a visual update the change is very laggy. I'm seeing approximately 700ms delay in 'down' state interactions.

Reproduce Scenario (including but not limited to)

Browse the site on a pixel 2 or similar mobile devices.

Steps to Reproduce

Tap on a button and observe the delay in the down / up state transitions.

Browser name/version/os (ie Chrome Version 62.0.3202.94 (Official Build) (64-bit) MacOS)

Chrome, Android 9. Pixel 2.

Spectrum-CSS version

Current.

@GarthDB
Copy link
Member

GarthDB commented Nov 17, 2018

Spectrum-CSS is just the css. We can use a small js lib for the docs to reduce the default mouse interaction delays. Something the js implementations should do. We’d also need to document it somewhere for people just wanting the css to use I their own projects.

@benjamind
Copy link
Contributor Author

Why does it need JS to solve slow update of css active pseudo selectors? I do not believe these are delayed on mobile. I can tap a button and watch the active state occur well after my finger has come up, I think this is another issue caused by the size of the docs page.

@GarthDB
Copy link
Member

GarthDB commented Nov 17, 2018

I assumed you were referring to the 300ms click delay.

@filmaj filmaj added documentation Because documentation is important and shouldn't be broken performance labels Nov 21, 2018
@filmaj
Copy link
Contributor

filmaj commented Nov 21, 2018

Do you think this has anything to do with #6 - that is, the extensiveness of the DOM on the docs page has something to do with this, or is this something we can isolate to outside of the docs page?

@benjamind
Copy link
Contributor Author

Potentially yes. the pseudo selector change causes a style recalculation which in turn can cause update layer tree, layout and paint operations. All these are potentially impacted by the size of the DOM. From a quick check on my desktop, mouse down or over one of our elements causes recalculate style then a number of layer tree updates. That update is taking ~16ms, and this is on a high end i7 with a gaming GPU. That layer tree cost is going to impact mobile a lot more.

@misterbrownlee
Copy link
Collaborator

This was fixed by the docs update a while back. Thanks for the input, everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Because documentation is important and shouldn't be broken
Projects
None yet
Development

No branches or pull requests

4 participants