Fix a bug where 'resize' events wouldn't get fired if the element was initially hidden