-
Notifications
You must be signed in to change notification settings - Fork 34
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
Fix the example: remove api token error when we fetch recipes #112
Conversation
example/geny-window.js
Outdated
const selectElement = document.querySelector('#listRecipes'); | ||
// Remove our "warning" select option about an invalid/missing api token. | ||
selectElement.remove(0); | ||
const placeholderOption = document.createElement('option'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well play, but the bug is worth that what you detect. Every time the input apitoken loose focus, the recipes list is added to the previous.
This will fix all issues
const selectElement = document.querySelector('#listRecipes');
// Flush select before adding new options
selectElement.innerHTML = '';
const placeholderOption = document.createElement('option');
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well play, but the bug is worth that what you detect. Every time the input apitoken loose focus, the recipes list is added to the previous.
Ah, nice catch! 😅
I've adjusted the fix with your suggestion. Thanks!
4ee98c0
to
3c696e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank for this PR !
Description
This fixes a minor bug where we had an error message in the recipe selection list.
Steps to reproduce:
Before:
With the fix:
Type of change
Checklist