added minWidth option to solve issue where menu stayed open after going from small widths to big widths