0
我有一些autocompletes終於工作,但有一種行爲,我想改變。如果用戶鍵入部分值並單擊返回列表之外的任何位置,則會在輸入中設置部分值。如果用戶沒有選擇一個返回的選項,我寧願該值保持空白。jquery自動完成行爲修改
它看起來像的焦點事件是什麼,我應該改變,但我發現了API彆扭......它說:
Before focus is moved to an item (not selecting), ui.item refers to the focused
item. The default action of focus is to replace the text field's value with the
value of the focused item, though only if the focus event was triggered by a
keyboard interaction. Canceling this event prevents the value from being updated,
but does not prevent the menu item from being focused.
,但它並沒有給出如何取消事件爲例。