Hey everyone, check out the project I'm currently working on over at Github: https://github.com/joelt11753/Udacity-map
In this project, I have a menu generated from a list that can be filtered using an HTML select element. Initially, all items are displayed but upon selecting another option, the menu should change accordingly. However, I am facing an issue where the menu needs to be reset every time the filter is applied.
If you take a look at the app.js file located in the js folder, there's a computed observable on line 8 responsible for filtering the menu. In particular, pay attention to line 10 where I set the viewList() function to empty in order to start fresh with each user selection. Strangely, this only seems to work when the default option (the "if" statement on line 11) is chosen. Line 20 begins the block that displays the filtered menu and while the console.log on line 21 shows the correct number of items, the reset doesn't happen as expected. Essentially, my question is why does the reset not occur every time a new selection is made? When trying out the app, choosing any option other than the default should clear the menu, but it doesn't seem to be functioning properly.
Your insights would be greatly appreciated. Thank you!