Previously, the dropdown had a bug where the first item
was highlighted regardless of the selected option.
This commit fixes the bug, ensuring that the
selected option is now correctly highlighted.
Fixes: #33066
Previously, the topic / direct message recipient input box was always
focused when the compose select recipient dropdown got closed, even if
the user clicked elsewhere. This resulted in unwanted trigger of
onFocus event listener etc.
This adds an early return to ensure focus updates only when an item
is clicked.
Currently, when the saved snippets are added or removed the changes
are not properly shown across different browser tabs if the dropdown is
open. This commit fixes this.
Adds `sticky_bottom_option` element to the `dropdown_widget` to
support moving of "Add a new saved snippet" button to the bottom
sticky area of the dropdown for better accessibility and UX.
This is follow-up of #31359 that moves "Saved snippets" button from
"send_later" popover to message formatting buttons and adds support
to use saved snippets in message-edit UI.
Fixes#31830.
The new saved replies feature requires removing saved replies by clicking on
trash icon on dropdown item. So dropdown widget should allow more than
one click without closing it to delete multiple saved replies.
Reset event handlers attached to the dropdown widget and by removing
it from DOM.
User is unlikely to use the same dropdown multiple times, even if
they do, the operation is fast.
This was due to reference being hidden by keyboard or scrolled
offscreen. We fix it by showing the dropdown even if the reference
is hidden for mobile devices.
If `disable_for_spectators` is true, the widget text is greyed out
but the tippy instance is still delegated, causing it to appear
on click/enter.
This commit fixes that by not delegating tippy if the
`disable_for_spectators` is true.
This bug was surfaced when it was found that the
topic type filter in Recent conversations has disabled
styling for spectators, but a spectator could still click on it to
open the dropdown.
Fixes#30461
When user is trying to open a modal after clicking on a button
in a popover, we call popovers.hide_all() before opening the modal
which hides the popover but since the event handler call isn't
finished running yet, we call instance.hide() again resulting in
tippy throwing errors that this could be a memory leak.
We introduce a wrapper function for `instance.hide` which if
the popover/tooltip is visible before hiding it to fix it.