Skip to content

Commit 004c462

Browse files
PeterYangIOrezrah
andauthored
Remove unnecessary label title (#1826)
* remove label title * add changeset Co-authored-by: Rez <rezrah@github.com>
1 parent 11a76b3 commit 004c462

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

.changeset/slow-fireants-shave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/react': patch
3+
---
4+
5+
Remove unnecessary "required field" label title in favor for native `required` input attribute

src/_InputLabel.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ const InputLabel: React.FC<Props & SxProp> = ({children, disabled, required, vis
1515
isVisible={!visuallyHidden}
1616
as="label"
1717
htmlFor={htmlFor}
18-
title={required ? 'required field' : undefined}
1918
sx={{
2019
fontWeight: 'bold',
2120
fontSize: 1,

src/__tests__/InputField.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('InputField', () => {
6666
</SSRProvider>
6767
)
6868

69-
const input = getByRole('textbox')
69+
const input = getByRole('textbox', {name: TEXTINPUTFIELD_LABEL_TEXT})
7070

7171
expect(input.getAttribute('required')).not.toBeNull()
7272
})

0 commit comments

Comments
 (0)