mirror of https://github.com/zulip/zulip.git
upload-widget: Correct file input clearing.
Replacing file input doesn't work for value clearing. The best way is to clean value directly, which excludes accidentally adding wrong file after upload-widget validation error.
This commit is contained in:
parent
8ae35211b5
commit
831a467fa3
|
@ -39,8 +39,7 @@ var upload_widget = (function () {
|
||||||
|
|
||||||
function clear() {
|
function clear() {
|
||||||
var control = get_file_input();
|
var control = get_file_input();
|
||||||
var new_control = control.clone(true);
|
control.val('');
|
||||||
control.replaceWith(new_control);
|
|
||||||
file_name_field.text('');
|
file_name_field.text('');
|
||||||
clear_button.hide();
|
clear_button.hide();
|
||||||
upload_button.show();
|
upload_button.show();
|
||||||
|
|
Loading…
Reference in New Issue