I am using the included Codex model, and I asked it to handle an event in a text area. This is what it did :
self._numbers_keydown_handler = anvil.js.report_exceptions(self.text_area_numbers_keydown)
anvil.js.get_dom_node(self.text_area_numbers).addEventListener(
"keydown", self._numbers_keydown_handler
)
Now, it works. But I would have thought it would have used a more “anvillic” method of adding events rather than adding it to the dom node?
I’ve been adding quite a lot of code recently using AI and I’ve not checked all of it. Whilst it all works (and works well), I wonder if it’s doing other non-avillic things?
Anyone else seen this? Is it to be expected?
edit - maybe there’s a better way to prompt it to get it to follow anvil style, but the agent instructions seem to steer it towards anvil-style.