-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Only show country dropdown without autocomplete (#5652)
Co-authored-by: iamareebjamal <jamal.areeb@gmail.com>
- Loading branch information
1 parent
9c25bec
commit 70c2285
Showing
11 changed files
with
77 additions
and
110 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Component from '@glimmer/component'; | ||
import { orderBy, filter } from 'lodash-es'; | ||
import { paymentCountries } from 'open-event-frontend/utils/dictionary/payment'; | ||
import { countries, Country } from 'open-event-frontend/utils/dictionary/demography'; | ||
|
||
export default class CountryDropdown extends Component { | ||
get countries(): Country[] { | ||
return orderBy(countries, 'name'); | ||
} | ||
|
||
get paymentCountries(): Country[] { | ||
return orderBy(filter(countries, country => paymentCountries.includes(country.code)), 'name'); | ||
} | ||
} |
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,24 @@ | ||
<form class="field"> | ||
<label class={{if @required 'required'}}>{{@placeholder}}</label> | ||
<UiDropdown | ||
@class="search selection" | ||
@selected={{@val}} | ||
@forceSelection={{false}} | ||
@fullTextSearch={{true}}> | ||
<Input | ||
@type="hidden" | ||
@autocomplete="no" | ||
@value={{@val}} | ||
@id={{@id}} /> | ||
<i class="dropdown icon"></i> | ||
<div class="default text">{{t 'Select country'}}</div> | ||
<div class="menu"> | ||
{{#each (if @paymentCountries this.paymentCountries this.countries) as |country|}} | ||
<div class="item" data-value="{{country.name}}"> | ||
<i class="{{lowercase country.code}} flag"></i> | ||
{{country.name}} | ||
</div> | ||
{{/each}} | ||
</div> | ||
</UiDropdown> | ||
</form> |
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
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
70c2285
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.
Successfully deployed to the following URLs: