-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added custom placeholder option. #46
base: master
Are you sure you want to change the base?
Conversation
added custom placeholder option. Users can show placeholder if doesn't selected any item.
added custom placeholder option.
updated placeholder for custom placeholder. I missed update readme.md
Can you check again? @JuanRaymundo |
Users now can set placeholder option from html attribute.
Updated readme.md for set placeholder option from html attribute.
@@ -21,6 +22,9 @@ import 'styles/main.scss'; | |||
beforeDecrement: () => true, | |||
beforeIncrement: () => true, | |||
setSelectionText (itemCount, totalItems) { | |||
if (totalItems == 0 && this.placeHolderText != '') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
equality and inequality should use ===
and !==
accordingly
@@ -36,6 +40,7 @@ import 'styles/main.scss'; | |||
const dataAttrOptions = { | |||
selectionText: $selection.data('selection-text'), | |||
textPlural: $selection.data('text-plural'), | |||
placeHolderText: $this.data("placeholder"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strings must use single quotes. you can check for lint errors running yarn lint
@@ -116,6 +116,8 @@ $(document).ready(() => { | |||
selectionText: 'item', | |||
// text to show for multiple items | |||
textPlural: 'items', | |||
// text to show placeholder | |||
placeHolderText: 'Custom Placeholder', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think placeholder
is a better name so it matches the data-prop attribute
added custom placeholder option. Users can show placeholder if doesn't selected any item.