Hi all! Total Perchance newbie here, so I sincerely apologize if this is obvious/already been answered. Been having fun tinkering with it, but got this weird bug...
I've got a bit of a scuffed loop set up to select a word for each letter input by the user. However, the output of filterList() isn't happy with my using selectOne on it, producing an extra two undefineds for some strange reason. I don't know if it's maybe related to the way I'm filtering the list or some other bug? Anyone know why this is happening/a better way to do it?
Thanks for all y'all's help!
4 Comments
BluePower@sh.itjust.works · 2 pts · 2y
You can prevent the output from accidentally evaluating the
selectOneof emptynarrays by just not evaluating the<span contenteditable ...part when that empty array has no length (basically you put a condition in which ifnisn't empty then evaluate the span word element, which eliminates that syntax error problem):You can also check for
n.length > 0instead ofn.length. Also pretty cool generator concept! A random letter generator button might be a good idea. Here's how would you implement this using a list and a button:xfebruary@lemmy.world · 1 pts · 2y
Bless, thank you for your wisdom! That seems to have patched it -- is there a way to mark this post as solved? I suppose this is a more foolproof way of negotiating user input if it isn't an actual letter, for example.
BluePower@mastodon.social · 2 pts · 2y
@xfebruary You could simply tag the post as solved, simply by adding [Solved] to the title of the post.
VioneT@lemmy.world · 1 pts · 2y
You can use the select-until-plugin instead of
filter-list-plugin.