LPS-42215 - Add the class in one pass to prevent reflow/repaint