Add `onResize` event and fix selector issue on orientation change