-
Notifications
You must be signed in to change notification settings - Fork 35
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
[FEATURE] Add allowDropdown option #134
Conversation
a7119d3
to
10825ef
Compare
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.
Excellent, thank you! Sorry for taking so long to review.
I added two minor comments. Once they are resolved, it looks good to me.
{{#docs-demo as |demo|}} | ||
{{#demo.example name="phone-input-allow-dropdown-option.hbs"}} | ||
|
||
<p>{{phone-input allowDropdown=false initialCountry="fr" update=(action "handleUpdate")}}</p> |
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.
<p>{{phone-input allowDropdown=false initialCountry="fr" update=(action "handleUpdate")}}</p> | |
<p>{{phone-input allowDropdown=false number=allowDropdownNumber initialCountry="fr" update=(action "updateAllowDropdown")}}</p> |
If we add a number and a dedicated update method, it won't interfere with other phone-input occurences on this page.
Note that we probably want to update the tests/dummy/app/pods/docs/components/phone-input/all-options/component.js
to implement the update method. That way, the sandbox UI will be 100% working.
Really sorry I've left this here for so long. I was confident my company was going to need this feature when we added this add on. Turns out we didn't. And around that time I also muted my github notifications. 😝 I've updated the PR and happy to help get it over the finish line. Otherwise, feel free to close it. 😄 |
test('can prevent the dropdown', async function(assert) { | ||
assert.expect(1); | ||
|
||
await this.owner.lookup('service:phone-input').load(); |
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.
The library is loaded in a beforeEach
hook: https://github.com/qonto/ember-phone-input/pull/134/files#diff-0e2859b8508db13adaa5918464d0aeecR10
You can safely remove this line.
await this.owner.lookup('service:phone-input').load(); | ||
|
||
this.set('update', value => { | ||
this.set('allowDropdown', value); |
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.
Sorry I was not clear enough on the update method. Here you need to update the number, not the allowDropdown option.
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.
Or you might be able to remove it at all
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.
Thank you for finishing this!
Released in a v3.1.0 |
@dcyriller Thanks for your help! |
No description provided.