选择此项目后,如何使分割按钮菜单项滚动到视图中?

时间:2023-01-19 10:04:07

I have used YUI 2.6 for a while. Now, I realized the Split Button of YUI doesn't behave like the standard select html element. After an item is selected, when displaying the list again, it neither highlight or scroll that item into view at all. In the worst case, if I have 200 items, the user has selected the 100th item, when he/she wants to change his/her choice, he/she has to scroll from the beginning. It is not user-friendly at all. Unlike the standard select html element, it does highlight and scroll that item into view. Any idea is really appreciated.

我已经使用了YUI 2.6一段时间了。现在,我意识到YUI的Split按钮的行为与标准的select html元素不同。选择一个项目后,再次显示列表时,它根本不会突出显示或滚动该项目。在最坏的情况下,如果我有200个项目,则用户选择了第100个项目,当他/她想要改变他/她的选择时,他/她必须从头开始滚动。它根本不是用户友好的。与标准的select html元素不同,它会突出显示并将该项目滚动到视图中。任何想法都非常感激。

1 个解决方案

#1


I suspect that large numbers of items in the menu isn't a use case that the split button menu was designed to handle. Unlike a select input element users can't quickly filter to the option they would like to select using the keyboard. Think about if the initial item the user wanted to select was the 100th item - they'd also have to scroll from the beginning anyway.

我怀疑菜单中的大量项目不是分割按钮菜单设计用来处理的用例。与选择输入元素不同,用户无法快速过滤到他们想要使用键盘选择的选项。想想用户想要选择的初始项目是否是第100项 - 他们还必须从头开始滚动。

Maybe there's a better approach to take for what you are trying to do given context of your problem. If you provide more details about what you are wanting to help the user achieve maybe others will have ideas on some different approaches.

考虑到问题的背景,也许有更好的方法来考虑你想要做的事情。如果您提供有关您希望帮助用户实现的内容的更多详细信息,则其他人可能会对某些不同的方法有所了解。

#1


I suspect that large numbers of items in the menu isn't a use case that the split button menu was designed to handle. Unlike a select input element users can't quickly filter to the option they would like to select using the keyboard. Think about if the initial item the user wanted to select was the 100th item - they'd also have to scroll from the beginning anyway.

我怀疑菜单中的大量项目不是分割按钮菜单设计用来处理的用例。与选择输入元素不同,用户无法快速过滤到他们想要使用键盘选择的选项。想想用户想要选择的初始项目是否是第100项 - 他们还必须从头开始滚动。

Maybe there's a better approach to take for what you are trying to do given context of your problem. If you provide more details about what you are wanting to help the user achieve maybe others will have ideas on some different approaches.

考虑到问题的背景,也许有更好的方法来考虑你想要做的事情。如果您提供有关您希望帮助用户实现的内容的更多详细信息,则其他人可能会对某些不同的方法有所了解。