mirror of
https://github.com/morris/vanilla-todo.git
synced 2025-08-20 21:02:10 +02:00
fix issues with input focus
This commit is contained in:
@@ -13,7 +13,7 @@ VT.TodoCustomList = function (el) {
|
||||
'<div class="header">',
|
||||
' <h3 class="title"></h3>',
|
||||
' <p class="form">',
|
||||
' <input type="text" class="input">',
|
||||
' <input type="text" class="input use-focus-other">',
|
||||
' <button class="app-button delete"><i class="app-icon" data-id="trashcan-16"></i></button>',
|
||||
' </p>',
|
||||
'</div>',
|
||||
@@ -48,6 +48,10 @@ VT.TodoCustomList = function (el) {
|
||||
saveOnBlur = true;
|
||||
});
|
||||
|
||||
inputEl.addEventListener('focusOther', function () {
|
||||
if (state.editing) save();
|
||||
});
|
||||
|
||||
inputEl.addEventListener('keyup', function (e) {
|
||||
switch (e.keyCode) {
|
||||
case 13: // enter
|
||||
|
Reference in New Issue
Block a user