Is it bad practice to set objects as non-scrollable?

Hi!

Is it bad practice to set objects on the screen as non-scrollable? Maybe due to padding or other space and size related characteristics, an object becomes scrollable and you can drag it left - right, up - down or both, although the object / objects look fine in the default state and they are all well spaced and aligned on the screen.

Therefore, would it be bad practice to make it non-scrollable and should you focus on fixing the problem without a work-around? For example I use this function sometimes when, even thought everything looks perfect, buttons, widgets and labels are all well aligned and spaced, there is a scrollbar present:

lv_obj_set_scrollbar_mode(obj, LV_SCROLLBAR_MODE_OFF);
lv_obj_set_scroll_snap_x(obj, LV_SCROLL_SNAP_NONE);
lv_obj_set_scroll_snap_y(obj, LV_SCROLL_SNAP_NONE);

lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE);
lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_ELASTIC);
lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN);

I see it is not a bad practice.

For mobile - like UX, any screen should scrollable, special drag the screen scroll down is default for calling the Content Refreshing functional.

For other UX, a scroll action may accidentially move one panel to another one, that’s not good, eg: Dragging to left / right a tabview would move the current tab to the next one, that’s not an expected behavious. So in this case, we should set the container as non-scrollable, even if a scrollbar presents or not.

1 Like

My thought was that, in certain cases, an object might become scrollable due to issues related to its size (eg: a container becomes scrollable even though the objects within it don’t visibly overpass its boundaries). Therefore I thought that it might be a symptom of another underlying problem.

Hello,

I view it as bad practice depending on what you are trying to achieve.

If you want an object that should be scrollable some time in the future, it’s best not to touch this flag and focus on fixing what is actually wrong. Usually this happens because of the object padding and object border style properties.

However if the object is something that should never be scrollable by the user anyway, just enable this flag to be sure. For instance if you have a small header bar on top of your regular display, the user will probably never expect/be able to scroll in this object anyway.

1 Like