-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PBNTR-381] Implementing form resetting and blank selection prop (#3529)
**What does this PR do?** Implementing form resetting and blank selection prop. **Screenshots:** ![image](https://github.com/user-attachments/assets/3df9eb1b-248d-4589-9989-c19e05079390) **How to test?** 1. Go to the Dropdown kit page. 2. Scroll down to "Blank Selection" doc example (last one) #### Checklist: - [x] **LABELS** Add a label: `enhancement`, `bug`, `improvement`, `new kit`, `deprecated`, or `breaking`. See [Changelog & Labels](https://github.com/powerhome/playbook/wiki/Changelog-&-Labels) for details. - [x] **DEPLOY** I have added the `milano` label to show I'm ready for a review. - [ ] **TESTS** I have added test coverage to my code.
- Loading branch information
1 parent
54143ff
commit 192080e
Showing
9 changed files
with
96 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
playbook/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<% | ||
options = [ | ||
{ label: 'United States', value: 'United States', id: 'us' }, | ||
{ label: 'Canada', value: 'Canada', id: 'ca' }, | ||
{ label: 'Pakistan', value: 'Pakistan', id: 'pk' }, | ||
] | ||
|
||
%> | ||
|
||
<%= pb_rails("dropdown", props: { blank_selection: "Select One...", options: options }) %> |
31 changes: 31 additions & 0 deletions
31
playbook/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react' | ||
import { Dropdown } from '../../' | ||
|
||
const DropdownBlankSelection = (props) => { | ||
const options = [ | ||
{ | ||
label: "United States", | ||
value: "United States", | ||
}, | ||
{ | ||
label: "Canada", | ||
value: "Canada", | ||
}, | ||
{ | ||
label: "Pakistan", | ||
value: "Pakistan", | ||
} | ||
]; | ||
|
||
return ( | ||
<> | ||
<Dropdown | ||
blankSelection="Select one..." | ||
options={options} | ||
{...props} | ||
/> | ||
</> | ||
) | ||
} | ||
|
||
export default DropdownBlankSelection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters