So today, I managed to make one of my colleagues feel like an idiot. In this contract, I work mostly for ui integration, while he build the pages with angular before I add all the html structure and fancy css.

We are building the front-end/ui for an industrial device with a touch screen. For that last 2 days he was blocked on a bug that when you click the confirm button on a delete popup, it would somehow select an input in the page before it was deleted and would lock the ui when showing the virtual keyboard (the poor thing didn't know what to do and wouldn't close).

During those two days, he asked all the other devs for help, trying to find a pattern or anything that could help, while I was focused on writing my css and stuff since it was my priority and I was hired specifically for that (I was aware of the bug and gave my input but I never saw it being reproduced)

So today, he start his new routine of raging at his desk and he decides to show me on my device for some reason. I immediately notice a pattern. It would always select one of the two fields behind the popup, in the click area of the button (it's a big button). Then, I noticed that I could press a random spot on the screen, drag my finger on the button and let go and nothing would happen.

It's at this moment I knew I had found the bug. The button was set to emit an event on mousedown while the inputs behind it were set to emit an event on mouseup (like it should be everywhere). So the popup closed when you placed your finger on the screen and the input was selected immediately after when you removed your finger (which was usually faster than the page code which was not yet optimized)

After that, it was just an easy fix to change the listener and I had a free beer.

Add Comment