Skip to content

Commit eda2d9e

Browse files
danxuliubackportbot[bot]
authored andcommitted
Fix persistent tooltip in the "new folder" input of the file picker
When a new folder is tried to be created in the file picker dialog a tooltip is shown on the input if the folder name exists already. However, this tooltip was not cleared, so it was still shown even if the name was fixed, the folder was created and then the "New folder" input was shown again. Now the tooltip is cleared as soon as the input changes, as keeping it shown in that case did not provide any benefit either (and it is consistent with how the "new folder" input works in the Files app view). The input is also cleared whenever the menu that shows the input is opened again, as otherwise the tooltip would be still shown if the menu was closed and opened again without changing the input (and the menu could be opened again after changing to another directory where the new folder name is no longer duplicated). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
1 parent 7329a5e commit eda2d9e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/src/OC/dialogs.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ const Dialogs = {
335335
})
336336

337337
OC.registerMenu(newButton, self.$filePicker.find('.menu'), function() {
338+
$input.tooltip('hide')
338339
$input.focus()
339340
self.$filePicker.ocdialog('setEnterCallback', function() {
340341
event.stopImmediatePropagation()
@@ -435,6 +436,9 @@ const Dialogs = {
435436
$form.submit()
436437
}
437438
})
439+
$input.on('input', function(event) {
440+
$input.tooltip('hide')
441+
})
438442

439443
self.$filePicker.ready(function() {
440444
self.$fileListHeader = self.$filePicker.find('.filelist thead tr')

0 commit comments

Comments
 (0)