WebUI: Fix wrong file renaming selection range

This commit is contained in:
MR 2020-05-26 16:38:54 +08:00
parent b44816305f
commit af6cae0e09

View file

@ -38,7 +38,7 @@
const decodedName = decodeURIComponent(name);
$('rename').value = decodedName;
$('rename').focus();
$('rename').setSelectionRange(0, decodedName.indexOf('.'));
$('rename').setSelectionRange(0, decodedName.lastIndexOf('.'));
$('renameButton').addEvent('click', function(e) {
new Event(e).stop();