diff --git a/docs/changes.md b/docs/changes.md index 0c8c55295..4caf0a39c 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -4,6 +4,7 @@ * 修复拼写错误(感谢兆坤提供补丁) * 修复 demoui dialog(感谢兆坤提供补丁) * 增加tk_strs_bsearch + * 修复text_selector测试用例报错问题(感谢颖健提供补丁) 2024/11/14 * 修复 edit键盘长按Backspace键,弹出提示窗口后就不能连续删除字符(感谢兆坤提供补丁) diff --git a/src/ext_widgets/text_selector/text_selector.c b/src/ext_widgets/text_selector/text_selector.c index 53125985f..37c51be70 100644 --- a/src/ext_widgets/text_selector/text_selector.c +++ b/src/ext_widgets/text_selector/text_selector.c @@ -656,7 +656,9 @@ static ret_t text_selector_scroll_to(widget_t* widget, int32_t yoffset_end) { yoffset = text_selector->yoffset; if (yoffset == yoffset_end) { - text_selector_on_scroll_done(widget, NULL); + if (item_height > 0) { + text_selector_on_scroll_done(widget, NULL); + } return RET_OK; }