How to disable "scroll inside" for scrollable area?

Description

i want to stop scrolling when drag scroll bar to top or bottom.

What MCU/Processor/Board and compiler are you using?

PCsimulator

What LVGL version are you using?

V8.1

What do you want to achieve?

What have you tried so far?

try to turn off scroll.

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

/*You code here*/

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

To disable “scroll inside” (elastic/overscroll behavior) for a scrollable area, you can clear the LV_OBJ_FLAG_SCROLL_ELASTIC flag: [Forum Answer]

lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_ELASTIC);

Or using the dedicated setter: [lv_obj.h API]

lv_obj_set_scroll_elastic(obj, false);

This prevents the “rubber band” effect where content can be dragged beyond the top or bottom boundary before snapping back.

If you want to completely disable scrolling altogether (not just the elastic effect), use: [Scrollable Docs]

lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE);
/* or */
lv_obj_set_scrollable(obj, false);

This clips overflowing content instead of scrolling it.