File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1616 < h1 id ="todoTitle "> ToDo App</ h1 >
1717
1818 < div class ="enterTask ">
19- < input type ="text " placeholder ="Add your new todo " id ="taskInput ">
19+ < input type ="text " placeholder ="Add your new todo " id ="taskInput " autofocus >
2020 <!-- PLus ICON -->
2121 < svg xmlns ="http://www.w3.org/2000/svg " id ="addSvg " height ="1em " viewBox ="0 0 448 512 ">
2222 < path
Original file line number Diff line number Diff line change @@ -15,8 +15,9 @@ const completedTask = (task) => {
1515const editTaskText = ( task ) => {
1616
1717 // make the task text editable
18- const editTaskText = taskElement . querySelector ( ".taskText" ) ;
18+ const editTaskText = task . querySelector ( ".taskText" ) ;
1919 editTaskText . setAttribute ( "contenteditable" , "true" ) ;
20+ editTaskText . focus ( ) ;
2021}
2122
2223// add the task when click
@@ -61,7 +62,7 @@ taskContainer.addEventListener("click", (e) => {
6162 case 'task' :
6263 break ;
6364 case 'edit' :
64- editTaskText ( clickedElement ) ;
65+ editTaskText ( taskElement ) ;
6566 break ;
6667 case 'delete' :
6768 break ;
@@ -74,6 +75,6 @@ clearAllTaskBtn.addEventListener("click", () => {
7475
7576 if ( confirm ( "All the tasks will be cleared permanently." ) )
7677 {
77- // taskContainer.removeChild( );
78+ taskContainer . setHTML ( '' ) ;
7879 }
7980} ) ;
You can’t perform that action at this time.
0 commit comments