That’s why I prefer to use UI and JS libraries that are already tested and work consistently across browsers. It’s easier to reuse libraries across projects instead of reinventing the wheel, and spending time chasing down browser inconsistencies.
We often set ourselves up for failure by using JS APIs that don’t work across browsers, or hand rolling UI/CSS for each project.