Commit Graph

27 Commits

Author SHA1 Message Date
Anders Kaseorg
c81ef4d409 dropdown_widget: Fix Option typing.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-03-17 08:43:19 -07:00
whilstsomebody
865d847492 dropdown_widget: Fix dropdown highlighting in inbox/conversations menu.
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
2025-03-11 12:11:50 -07:00
Prakhar Pratyush
2b4d2f15f2 compose_recipient: Early return in on_hidden_callback if no item click.
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.
2025-02-26 14:03:22 -08:00
Vector73
41430661ee saved_snippets: Fix dropdown state sync across browser tabs.
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.
2025-02-14 11:51:40 -08:00
Vector73
55f1c2d90f saved_snippets: Fix Enter click on "Create a new saved snippet" button.
Using "Enter" key to click on "Create a new saved snippet" does not work
when the dropdown list is empty. This commit fixes that bug.
2025-02-11 10:17:06 -08:00
Vector73
51b47f4233 dropdown_widget: Add sticky_bottom_option element.
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.
2025-01-30 09:46:32 -08:00
Vector73
91ddfdadd6 saved_snippets: Move "Saved snippets" button to compose control buttons.
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.
2025-01-30 09:46:32 -08:00
Anders Kaseorg
49c72f8a09 dropdown_widget: Use util.the for $events_container.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-01-02 17:30:40 -08:00
Anders Kaseorg
77f97762c6 eslint: Fix unicorn/explicit-length-check. (#32666)
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-11 09:19:46 -08:00
Anders Kaseorg
ec3177c834 web: Add explicit extensions to imports.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 09:18:56 -08:00
Vector73
66113365a5 saved_snippets: Add new feature for saved snippets.
Fixes #31227.
2024-10-01 11:48:15 -07:00
Vector73
b2a07971ec dropdown_widget: Allow more than one click on dropdown.
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.
2024-09-03 09:20:27 -07:00
Aman Agrawal
7f38c95384 dropdown_widget: Fix click event being triggered multiple times.
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.
2024-08-20 09:56:59 -07:00
Aman Agrawal
82d3058b53 dropdown_widget: Remove unused instance property. 2024-08-20 09:56:59 -07:00
afeefuddin
19b85eb600 user_profile: Convert module to TypeScript. 2024-08-12 09:40:33 -07:00
Aman Agrawal
b91b643448 dropdown: Fix dropdown partially hidden at small heights.
We generalize the approach used for compose box to apply it for
all the dropdowns.
2024-07-15 12:33:00 -07:00
Aman Agrawal
e75ac2bfd1 dropdown_widget: Fix dropdown not displayed on mobile.
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.
2024-07-12 11:08:47 -07:00
Kislay Verma
d38d82edc3 dropdown_widget: Fix bug in disable_for_spectators
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
2024-06-20 12:09:04 -07:00
Anders Kaseorg
beef5d259b dropdown_widget: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg
507eb4913c tsconfig: Enable exactOptionalPropertyTypes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-16 08:58:20 -07:00
evykassirer
a8d261a68f dropdown_widget: Fix DropdownWidgetOptions.
Addresses this comment
https://github.com/zulip/zulip/pull/29611/files#r1559751399
2024-04-11 09:32:19 -07:00
evykassirer
9366d42f14 dropdown_widget: Pass current value to get_options to avoid hacky this. 2024-04-10 12:19:52 -07:00
Aman Agrawal
0a90a13bec popover_menus: Fix event handler trying to hide a hidden popover.
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.
2024-04-04 12:51:35 -07:00
Temidayo32
25ff0d4418 compose_recipient: Convert module to TypeScript. 2024-04-03 13:08:10 -07:00
afeefuddin
417d4b3a8a integration_url_modal: Convert module to TypeScript. 2024-03-19 09:38:22 -07:00
Aman Agrawal
04cf552884 dropdown_widget: Replace widget_id with widget_selector. 2024-02-22 16:38:25 -08:00
Aman Agrawal
a9dc669f3c dropdown_widget: Migrate to typescript. 2024-02-22 16:38:25 -08:00