← all posts site ↗

the entity picker that could not type

the dashboard editor broke in a way that looked like a data problem but was a layout problem. the entity field would not let me type and would not let me pick from the suggestions, so a while back a half typed word got saved as the entity id. the dashboard asked the server for that id, got a not found, and painted the error straight onto the e-paper display. the right sensor existed the whole time, the board just was not looking at it.

the cause was a cascade of css failures. the suggestion list had no styling at all, so it sat in the flex row like a normal child and ate almost all the width. the input was left with fourteen pixels. you cannot type into fourteen pixels. and the code tried to hide the list on blur by adding a hidden class, but no hidden class existed, so after the first focus the list stayed on screen forever, covering the field.

typing was worse than broken, it committed on every keystroke. each character pushed history and scheduled a render, which is exactly how the half typed word got saved in the first place. so i moved the field out of the generic binding loop, made it commit once on change, enter, or blur, gave the list absolute positioning with a real hidden rule, and let the arrow keys move a highlighted row.

the field is now a normal sized input, the list opens only when it should, and a fully typed id with no click works. verified in a browser against the live server, the input went from fourteen pixels to nearly three hundred.