From 7187b219828c46826426ecd4838f62d95575b995 Mon Sep 17 00:00:00 2001 From: Maxime Da Silva Date: Thu, 13 Oct 2022 17:55:00 +0200 Subject: [PATCH] feat(radio-field): add dirty/pristine classes and use it --- packages/react/lib/RadioField/index.js | 1 + .../react/lib/RadioField/index.test.js.snap | 50 +++++++++---------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/packages/react/lib/RadioField/index.js b/packages/react/lib/RadioField/index.js index 671976173..bc20de700 100644 --- a/packages/react/lib/RadioField/index.js +++ b/packages/react/lib/RadioField/index.js @@ -116,6 +116,7 @@ const RadioField = forwardRef(({ disabled, invalid: !state.valid, }, + state.dirty ? 'dirty' : 'pristine', className, )} ref={wrapperRef} diff --git a/packages/react/lib/RadioField/index.test.js.snap b/packages/react/lib/RadioField/index.test.js.snap index 9134e9aec..b517117e1 100644 --- a/packages/react/lib/RadioField/index.test.js.snap +++ b/packages/react/lib/RadioField/index.test.js.snap @@ -3,7 +3,7 @@ exports[` should add box if boxed class has been passed to Radio 1`] = `