Skip to content

Commit

Permalink
Improve changing of className
Browse files Browse the repository at this point in the history
  • Loading branch information
ewanharris committed Sep 5, 2023
1 parent cddf14e commit 7e38507
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions css/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,8 @@ loadingSize = 30px
background #ffffff
border 1px solid #ffffff
.auth0-lock-input-checkbox.auth0-lock-error .auth0-lock-input-wrap
span
span.no-hint
color red
.dont-show-as-invalid
color rgba(0,0,0,0.54)

// Social

Expand Down
8 changes: 4 additions & 4 deletions src/__tests__/field/__snapshots__/custom_input.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exports[`CustomInput when type == checkbox and when placeholderHTML is set rende
type="checkbox"
/>
<span
className="dont-show-as-invalid"
className=""
dangerouslySetInnerHTML={
{
"__html": "<b>Placeholder</b>",
Expand Down Expand Up @@ -48,7 +48,7 @@ exports[`CustomInput when type == checkbox highlights placeholder text when no i
type="checkbox"
/>
<span
className="show-as-invalid"
className="no-hint"
dangerouslySetInnerHTML={
{
"__html": "<b>Placeholder</b>",
Expand Down Expand Up @@ -78,7 +78,7 @@ exports[`CustomInput when type == checkbox renders correctly as a CheckBoxInput
type="checkbox"
/>
<span
className="dont-show-as-invalid"
className=""
>
placeholder
</span>
Expand All @@ -105,7 +105,7 @@ exports[`CustomInput when type == checkbox shows an error when value is incorrec
type="checkbox"
/>
<span
className="dont-show-as-invalid"
className=""
dangerouslySetInnerHTML={
{
"__html": "<b>Placeholder</b>",
Expand Down
2 changes: 1 addition & 1 deletion src/ui/input/checkbox_input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default class CheckboxInput extends React.Component {
invalidHint
} = this.props;

const spanClass = invalidHint ? 'dont-show-as-invalid' : 'show-as-invalid'
const spanClass = invalidHint ? '' : 'no-hint'

return (
<InputWrap
Expand Down

0 comments on commit 7e38507

Please sign in to comment.