Skip to content
This repository was archived by the owner on Apr 16, 2022. It is now read-only.

#63 Notify user when trying to create a lesson with no notes#103

Open
edXmO wants to merge 3 commits intojrobind:masterfrom
edXmO:master
Open

#63 Notify user when trying to create a lesson with no notes#103
edXmO wants to merge 3 commits intojrobind:masterfrom
edXmO:master

Conversation

@edXmO
Copy link
Contributor

@edXmO edXmO commented Feb 23, 2021

Hi ! It's been a while, I'm sorry for not working on this before. I've been quite busy but found some time today and got something done.

  • Created a new style for the input title element to handle the invalid use case on form submit.
  • The addLesson function, now also checks for the content of input title element and replaceschanges the styling if content is invalid.
  • Took some time with the tooltip thingy, I was just fiddling around a bit with a span tag element and ::after pseudo-element to create a custom tooltip. Let me know if it needs a different styling, I'm not sure about the overall size and font-size so I'd appreciate feedback.
  • Another important question about the tooltip is the positioning. I realized that in lower screen sizes (and in the 900px media query) the positioning of the tooltip along with the clear button is a little off. I guess the answer is moving the tooltip somewhere else, but I'm not sure where to. I'd appreciate feedback on that too.

I think that's all for now, I'll be around to fix the changes on the positioning if needed. Thanks!

Copy link
Owner

@jrobind jrobind left a comment

Choose a reason for hiding this comment

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

Thanks for this, hope you're well! Glad to have you back contributing 😄

It's looking good! I've left some comments mainly regarding whether we should just stick with the native HTML tooltip validation? Either way, we want to keep your tooltip CSS code because we will need this going forward.

Ideally, once the CSS has been refactored into SCSS we would have a tooltip component so we could reuse this code there.

Let me know your thoughts!

flex: 1;
}

span.create-lesson-input-tooltip::after {
Copy link
Owner

Choose a reason for hiding this comment

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

I wonder if maybe we're better off sticking with the native HTML form validation? i.e. by using the required attribute. I think this code is still useful though and we shouldn't remove it. We will need tooltips at some point (we probably need them for the lesson tags).

Because we have some positioning issues on smaller screen sizes I wonder if we just leave the native HTML validation tooltip to do its job. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure I think that's the best option. I'll remove everything but the CSS code in regards to the custom tooltip and fix the issue with the required attribute instead.

placeholder="Lesson title"
required
/>
<span id="title-tooltip"></span>
Copy link
Owner

Choose a reason for hiding this comment

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

If we decided to remove the tooltip for the form validation we can keep the CSS but just remove the logic and markup for it.

tag.classList.contains("selected")
);

if (lessonTitle === "") {
Copy link
Owner

Choose a reason for hiding this comment

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

This check could also be !lessonTitle

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it!


input.create-lesson-input {
.create-lesson-input-invalid {
outline: none;
Copy link
Owner

Choose a reason for hiding this comment

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

This is fine, but when setting borders it can cause some layout shifting. box-sizing: border-box; means that padding and border are included in the width and height of an element. We could try using outline instead and see how that looks? I haven't tested it so it might look terrible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll test it out maybe it does look better.

@jrobind
Copy link
Owner

jrobind commented Feb 25, 2021

Also, I forgot to mention, in future can you please create a new branch before raising a pull request.

If you need some guidance, please follow the process outlined in this article: https://www.digitalocean.com/community/tutorials/how-to-create-a-pull-request-on-github

Thanks 😃

@edXmO
Copy link
Contributor Author

edXmO commented Feb 26, 2021

Also, I forgot to mention, in future can you please create a new branch before raising a pull request.

If you need some guidance, please follow the process outlined in this article: https://www.digitalocean.com/community/tutorials/how-to-create-a-pull-request-on-github

Thanks 😃

Sure, I'll create a new branch when addressing issues. Sorry for the inconvenience.

@jrobind
Copy link
Owner

jrobind commented Feb 28, 2021

Also, I forgot to mention, in future can you please create a new branch before raising a pull request.
If you need some guidance, please follow the process outlined in this article: https://www.digitalocean.com/community/tutorials/how-to-create-a-pull-request-on-github
Thanks 😃

Sure, I'll create a new branch when addressing issues. Sorry for the inconvenience.

Thanks! No need to set up a new branch for these changes, just remember for future PR's 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants