Skip to content

Commit

Permalink
fix: issue with invalid message not showing for is([data-semantic], :…
Browse files Browse the repository at this point in the history
…empty) (#2978)
  • Loading branch information
nmerget authored Sep 27, 2024
1 parent 93d09b4 commit 6968663
Show file tree
Hide file tree
Showing 16 changed files with 15 additions and 6 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions packages/components/src/styles/_form-components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ $check-border-size: min(#{variables.$db-border-height-2xs}, 2px);
.db-infotext {
margin-block-start: variables.$db-spacing-fixed-2xs;

&:is([data-semantic], :empty) {
&[data-semantic] {
display: none;
}
}
Expand Down Expand Up @@ -197,7 +197,7 @@ $check-border-size: min(#{variables.$db-border-height-2xs}, 2px);
--db-#{$variant}-on-bg-basic-emphasis-100-default
);
--db-adaptive-on-bg-basic-emphasis-60-default: var(
--db-#{$variant}-border
--db-#{$variant}-on-bg-basic-emphasis-60-default
);
}
}
Expand Down
7 changes: 7 additions & 0 deletions showcases/react-showcase/src/components/form/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ const FormInputs = () => {
setUncontrolled(event.target.value);
}}
/>
<DBInput
label="Test label"
variant="floating"
invalidMessage="Test message"
validMessage=""
required
/>
</FormWrapper>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["Required required unchecked checkbox","Required","Required - Indeterminate mixed checkbox","Required","Required required unchecked checkbox","TODO: Add a validMessage","Required","TODO: Add a validMessage","Required - Indeterminate mixed checkbox","TODO: Add a validMessage","Required","Required TODO: Add a validMessage required checked checkbox","Select this checkbox","Required","Select this checkbox","Required - Indeterminate mixed checkbox"]
["Required required unchecked checkbox","Required","Required - Indeterminate required mixed checkbox","Required","Required required unchecked checkbox","TODO: Add a validMessage","Required","TODO: Add a validMessage","Required - Indeterminate required mixed checkbox","TODO: Add a validMessage","Required","Required TODO: Add a validMessage required checked checkbox","Select this checkbox","Required","Select this checkbox","Required - Indeterminate required mixed checkbox"]
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["check box, not checked, required, Required","TODO: Add a valid Message. checked","Required","TODO: Add a valid Message","Required","check box, checked, required, Required","Please check this box if you want to proceed.. not checked","Required","Please check this box if you want to proceed.","check box, half checked, Required Indeterminate"]
["check box, not checked, required, Required","TODO: Add a valid Message. checked","Required","TODO: Add a valid Message","Required","check box, checked, required, Required","Please check this box if you want to proceed.. not checked","Required","Please check this box if you want to proceed.","check box, half checked, required, Required Indeterminate"]
3 changes: 2 additions & 1 deletion showcases/screen-reader/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ const standardPhrases = [
const flakyExpressions: Record<string, string> = {
'pop-up': 'pop up',
'checked. checked': 'checked',
'selected. selected': 'selected'
'selected. selected': 'selected',
'expanded. expanded': 'expanded'
};

const cleanSpeakInstructions = (phraseLog: string[]): string[] =>
Expand Down
3 changes: 2 additions & 1 deletion showcases/shared/checkbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@
"name": "Required - Indeterminate",
"props": {
"name": "Requirement",
"indeterminate": true
"indeterminate": true,
"required": true
}
}
]
Expand Down

0 comments on commit 6968663

Please sign in to comment.