better handling of touch input to close sidebar