dash-daq icon indicating copy to clipboard operation
dash-daq copied to clipboard

Add bi-directional props to Joystick component

Open mtwichan opened this issue 5 years ago • 2 comments

In cases where the joystick should only move in 2 directions (up and down only or left and right only) it would be nice to have it so the joystick only moves in the two specified directions, so users don't get confused with empty commands.

mtwichan avatar Jul 18 '18 19:07 mtwichan

it's supported by nipplejs (used by dash-daq) out of the box.

yoannmoinet avatar Sep 03 '19 15:09 yoannmoinet

you can now give two new props to the joystick component for the same.

Preview

https://user-images.githubusercontent.com/41485085/138562308-2d5d5ac4-8633-4df0-b8a4-7bd93260e705.mov

Code

This will lock the movement of stick in Y direction so you can only move it vertically. Joystick( label="Joystick", labelPosition="bottom", lockX=False, lockY=True ),

Karan-S-Mittal avatar Oct 23 '21 15:10 Karan-S-Mittal