redoc icon indicating copy to clipboard operation
redoc copied to clipboard

Throttle decorator should throttle per function

Open srweeks opened this issue 3 years ago • 2 comments

Describe the bug The throttle decorator does not throttle per function. This is noticeable when two AppStores are instantiated and scrolling only works well for one store while the other store has janky scrolling.

https://github.com/Redocly/redoc/blob/508ebd58a3d66f2337e9641852322458a1bd9e6b/src/services/ScrollService.ts#L80-L82

Expected behavior Should throttle per function.

Minimal reproducible OpenAPI snippet(if possible)

Screenshots

Additional context Redocusaurus creates two stores for theming purposes.

srweeks avatar May 05 '22 14:05 srweeks

@srweeks Hi! Thank you for the issue. Please add additional steps to reproduce the problem. It'll very helpful to us.

AlexVarchuk avatar May 06 '22 08:05 AlexVarchuk

Sorry for the delay. Here is sandbox showing scrolling working only for the light theme. https://codesandbox.io/s/react-redoc-example-forked-d4ep85?file=/src/index.js

srweeks avatar May 16 '22 07:05 srweeks

It works for me. https://user-images.githubusercontent.com/14113673/185412235-ea8a80af-7df3-450f-a5b2-d7d0fbf648d0.mov

Also, you use the old version of redoc. Try to update it. If you still have this problem after the update, please reopen this issue and add a new sandbox.

Thanks a lot

AlexVarchuk avatar Aug 18 '22 13:08 AlexVarchuk