chore(filters): Add initial value support to suggestions list
Related issue: #590 (closed)
This MR updated our internal suggestions list component with two new features
Initial value support
Now you can pass initial-value
prop to list and this value will be pre-selected. It is important when we're editing for example operators from operator list (like =
!=
) to have original value preselected
Fix selecting list element in Safari/Firefox on OS X
Due to https://bugs.webkit.org/show_bug.cgi?id=22261 <button>
elements can't gain focus. In OS X that means that when we click suggestion item, relatedTarget
for event will be set to null
, and we can't distinguish between "just blurring input" and "picking element from suggestion list" which is important part of our filters logic (see https://gitlab.com/gitlab-org/gitlab-ui/-/blob/1d0bc82f3e74159e9572ba96a8af60ab701fc860/src/components/base/filtered_search/filtered_search_suggestion_control_mixin.js#L114)