DEV Community

Paul Kim
Paul Kim

Posted on

Hacktoberfest Week 3

For my third Hacktoberfest PR out of a required four, I continued worked on a project called Ordspel by avikantz.

Project Repository: https://github.com/avikantz/ikea-word-games
Issue: https://github.com/avikantz/ikea-word-games/issues/41
My Pull Request: https://github.com/avikantz/ikea-word-games/pull/42

Issue

A quick recap - Ordspel is a collection of linguistics games based on furniture names from the Ikea store. You can play it here - https://ikeawordgames.com

What was interesting was that not only was this a project I had previously worked on before (my previous PR), but this was an issue I posted myself. While working on disabling the non-solution characters in the Jumble keyboard (issue), I noticed that the keyboard would act funny. If there were more characters entered than allowed in the virtual keyboard, the characters would "overflow" and persist beyond the normal limit. It made for an unsatisfying user experience since you couldn't tell the bug was happening just by looking at it - you'd only realize the issue when you tried to backspace.

The Solution

Coming fresh off the previous issue, I was familiar with this project already (you can read my experiences here). The solution was to truncate the stored input value in the keyboard component (accessed via the keyboard component reference) if the value exceeded the maximum input size (link). This was an unfortunate circumstance of the keyboard's input value "desynchronizing" from the rest of the code. Since this input value was not maintained using React state but rather the simple keyboard API, there needed to be some extra checks and balances to make sure it was properly being watched.

Takeaways

It surprised me that such a bug was there and unreported until I discovered it. It really goes to show how selective all of our perceptions and experiences around the same software are. We all experience software uniquely and catch onto certain issues that other's won't know. It goes to show the power of the open source community and having an extra set of eyes watching over one's shoulder 👀.

Thanks for reading!

Top comments (0)