performance improvements by using updateStyles as well as only updating when typing stops