Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

can not change clipViewport and dragViewport state #17

Closed
salar-amr opened this issue Nov 6, 2021 · 2 comments
Closed

can not change clipViewport and dragViewport state #17

salar-amr opened this issue Nov 6, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@salar-amr
Copy link

hello , I noticed a button in pure no-vnc sdk which could change the state of clipViewport and dragViewport (true <=> false)

I implemented same strategy to get the same result but changing the state of these props does not change the behavior of vnc screen,
I faced this issue since the height of vnc screen is always more than the device and some time there is a need to drag the view to see the bottom of screen but when the clipViewport and dragViewport is true scrolling with touch events in mobile devices does not scroll the content of shared application

@roerohan
Copy link
Owner

roerohan commented Dec 3, 2021

@salar-amr

_rfb.clipViewport = clipViewport || false;
_rfb.dragViewport = dragViewport || false;

I just take the props and pass them in the noVNC library. When you used noVNC directly, can you show me your implementation that made it work? Maybe that will give me some insight into why this is failing.

@roerohan
Copy link
Owner

In #26, I've exposed the rfb object. So, if you have a code snippet like:

function App() {
  const vncScreenRef = useRef<React.ElementRef<typeof VncScreen>>(null);

  return (
    <VncScreen
      url={vncUrl}
      scaleViewport
      debug
      ref={vncScreenRef}
    />
  )
}

You can access the rfb object using vncScreenRef.current?.rfb. If the rfb object isn't set, it's value is null.

@roerohan roerohan self-assigned this Feb 26, 2022
@roerohan roerohan added the bug Something isn't working label Feb 26, 2022
Repository owner locked and limited conversation to collaborators Feb 27, 2022
@roerohan roerohan converted this issue into discussion #31 Feb 27, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants