mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
dropdown-list-widget: Properly handle disabled state.
We wrap the [reset] anchor tag in a button so that we can set 'disabled' attribute on it. We change the styles to hide the [reset] button and the pencil icon when the widget is disabled. We also need to call `e.preventDefault()` in the event handler since now the anchor tag behaves as a button.
This commit is contained in:
committed by
Tim Abbott
parent
f4e70714b4
commit
4d14ba41ba
@@ -14,7 +14,7 @@ const setup_zjquery_data = (name) => {
|
||||
$.clear_all_elements();
|
||||
const input_group = $(".input_group");
|
||||
const reset_button = $('.dropdown_list_reset_button');
|
||||
input_group.set_find_results('.dropdown_list_reset_button', reset_button);
|
||||
input_group.set_find_results('.dropdown_list_reset_button:not([disabled])', reset_button);
|
||||
$(`#${name}_widget #${name}_name`).closest = () => input_group;
|
||||
const $widget = $(`#${name}_widget #${name}_name`);
|
||||
return {reset_button, $widget};
|
||||
|
||||
Reference in New Issue
Block a user