Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

todo list #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

todo list #4

wants to merge 3 commits into from

Conversation

noaviten
Copy link

No description provided.

e.target.remove();
}
else{
e.target.style = 'text-decoration : line-through';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a bug 😢

}
});

for(let butt of document.querySelectorAll("button")){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Language!

});

for(let butt of document.querySelectorAll("button")){
butt.addEventListener("click", e =>{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since each button is an individual controller for a distinct action, we should add event listeners to them individually, not in a loop.

}


document.getElementById("write_item")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not listen to form's change event and check if form is valid? This opens up the door for new "validation" bugs.


document.getElementById("write_item")
.addEventListener("input", e =>{
if(e.target.value !== "" && e.target.value !== "Write up your todo here"){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value you see is called "placeholder". It's not literally a value.

document.querySelector("ul").prepend(item);
document.getElementById("write_item").value = "Write up your todo here";
document.getElementById("write_item").style.width = '';
document.getElementById("add").disabled = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use a form's .reset() method

}
});

document
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why reimplement the focus mechanism? Add tabindex=0 to the elements :)

@@ -14,11 +14,19 @@ <h1>ExCo.</h1>
</header>
<main>
<h2>My Todos List</h2>
<form>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But why not use a section? :(

<ul>
<li>Have morning coffee</li>
<li>Eat lunch</li>
<li>Make awesome things happen</li>
</ul>
<span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A span instead of a section? A SPAN?!?! 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants