Added class readonly if state is readonly