Skip to content

Commit

Permalink
Relax placeholder propType from string to Node
Browse files Browse the repository at this point in the history
  • Loading branch information
eemeli committed Mar 12, 2019
1 parent 71df767 commit 7c3f967
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ export type Props = {
options: OptionsType,
/* Number of options to jump in menu when page{up|down} keys are used */
pageSize: number,
/* Placeholder text for the select value */
placeholder: string,
/* Placeholder for the select value */
placeholder: Node,
/* Status to relay to screen readers */
screenReaderStatus: ({ count: number }) => string,
/*
Expand Down
8 changes: 7 additions & 1 deletion src/__tests__/Select.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1835,12 +1835,18 @@ cases(
},
{
'single select > should display default placeholder "Select..."': {},
'single select > should display provided placeholder': {
'single select > should display provided string placeholder': {
props: {
placeholder: 'single Select...',
},
expectPlaceholder: 'single Select...',
},
'single select > should display provided node placeholder': {
props: {
placeholder: <span>single Select...</span>,
},
expectPlaceholder: 'single Select...',
},
'multi select > should display default placeholder "Select..."': {},
'multi select > should display provided placeholder': {
props: {
Expand Down

0 comments on commit 7c3f967

Please sign in to comment.