-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(Dropdown): make deburr opt-in, and deburr input #2223
feat(Dropdown): make deburr opt-in, and deburr input #2223
Conversation
0789cf4
to
7122475
Compare
Codecov Report
@@ Coverage Diff @@
## master #2223 +/- ##
=========================================
Coverage ? 99.73%
=========================================
Files ? 151
Lines ? 2626
Branches ? 0
=========================================
Hits ? 2619
Misses ? 7
Partials ? 0
Continue to review full report at Codecov.
|
@levithomason I think I'm done now, but I would love some input on the prop naming before we merge! |
@@ -0,0 +1,25 @@ | |||
import React from 'react' | |||
import _ from 'lodash' | |||
import { Dropdown } from 'semantic-ui-react' |
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.
Let's sort imports in alphabetical order
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.
Of course! 😄 On it!
Is there a linting rule for this that I'm missing?
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.
Nope, we don't have or don't use it 🤔
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.
Alright. Btw, how do you sort it? Alphabetically by module name, i.e. react
, lodash
, and semantic-ui-react
?
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.
--> lodash
, react
, semantic-ui-react
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.
Yes, by module name.
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.
Thanks for updating. FWIW, there is a fixable lint rule for this that we should turn on sort-imports
so this is done automatically for people.
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.
@levithomason It seems that lint does not sort on the module name, but rather on the imported member, or am I missing something?
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.
@patrikmolsson Thanks, awesome work 👍 I've left styling comments, let's fix them
search={caseSensitiveSearch} | ||
selection | ||
fluid | ||
placeholder={'Try to search for case or CASE'} |
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.
And props in alphatical order, too 😄
search | ||
selection | ||
deburr | ||
options={options} |
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.
^
src/modules/Dropdown/Dropdown.js
Outdated
@@ -787,7 +791,7 @@ export default class Dropdown extends Component { | |||
// There are times when we need to calculate the options based on a value | |||
// that hasn't yet been persisted to state. | |||
getMenuOptions = (value = this.state.value, options = this.props.options) => { | |||
const { multiple, search, allowAdditions, additionPosition, additionLabel } = this.props | |||
const { multiple, search, allowAdditions, additionPosition, additionLabel, deburr } = this.props |
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.
Let's sort props there too
@layershifter There it is! By the way, what are your thoughts on the prop naming? Is it clear what |
@patrickgaskill |
@layershifter |
I've thought about this, but cannot really find an appropriate third option. |
Beautiful PR, I can see the care and attention to detail you put in. ❤️ Prop nameRegarding the prop name, lodash is the most installed NPM package and it calls this process A Unicode character with diacritics is called a "precomposed character". Example, In terms of Unicode equivalence, this is called "normalization". Java has a class called "Normalizer" which performs this operation. The Unicode Standard includes a Normalization Chart which maps these characters to one another. The technical process by which equivalent Unicode values are determined is called decomposition. So, I think we could go with @layershifter this is good to merge once you guys are settled on the most fitting prop name. |
I'm think that we can go with |
@levithomason Thanks for the input, and for the kind words! As @layershifter says, let's go with deburr |
@layershifter You tagged the wrong Patrick ;) |
@levithomason Can you merge this? As |
Sorry folks, Codecov is having issues finding a base to compare some PRs against and incorrectly failing statuses. This will go out in the next release, today or tomorrow. |
Released in |
WIP pull request. Would gladly appreciate feedback on both tests and source code!
Fixes #2163.