$('fltr1').onfocus = function() {
$('fltr1').setStyle({width: "auto"});
}
Using Prototype.js, I'm trying to make an IE7 compatible dropdown menu box change width to auto when the user clicks it. As it is now, when the user clicks this box, it successfully expands it's width, but the box doesn't open until you click again, requiring 2 clicks. The first click expands, the second click opens the box allowing you to select an item. It's like the first click triggers the set width event, then stops everything else and forces the dropdown shut. I've tried onclick and it does the same thing, adjusts the width but closes the dropdown until you second click.
How can I stop this from requiring two clicks? What is causing the dropdown to close when setting the width?