-
Notifications
You must be signed in to change notification settings - Fork 10
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
Improvements for Picker component #336
Conversation
if (!disabledSearch) { | ||
document.removeEventListener('keydown', onKeyDown); | ||
} | ||
}; | ||
}, []); |
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 'disabledSearch' and 'onKeyDown' should be added to the dependency table. Linter didn't complain about that?
size?: TriggerSize; | ||
placeholder?: string; | ||
isRequired?: boolean; | ||
noSearchResultText?: string; | ||
disableSearch?: boolean; |
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.
Aren't we following any naming convention for booleans?
Verbs should be restricted for functions/methods, while boolean should have an interrogative form, eg. isSearchDisabled
. The only exception is HTML syntax, eg. disabled
.
Alternatively I'd consider searchDisabled
@@ -14,6 +14,7 @@ $base-class: 'picker-list'; | |||
padding: 4px 0; | |||
position: absolute; | |||
width: 341px; | |||
z-index: 10000; |
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.
Is there any rule on how we use z-indexes
? Is there any stacking context?
@@ -14,6 +14,7 @@ const baseClass = 'picker-trigger'; | |||
export type TriggerSize = 'compact' | 'medium' | 'large'; | |||
|
|||
export interface ITriggerProps { | |||
disabledSearch: boolean; |
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'd consider alternative naming as in case of Picker
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.
Plus there is a difference -> disableSearch
vs disabledSearch
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 have some doubts regarding the naming convention. Everything else seems fine.
@@ -14,7 +14,7 @@ const baseClass = 'picker-trigger'; | |||
export type TriggerSize = 'compact' | 'medium' | 'large'; | |||
|
|||
export interface ITriggerProps { | |||
disabledSearch: boolean; | |||
isSearchDisabled: boolean; |
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.
Here we have isSearchDisabled
as this is an internal part of Picker
component, where our naming convention perfectly fits, the consumer doesn't see 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.
Fine for now, we'll rethink this later
/** | ||
* Definition of z-index values to be used across application. | ||
*/ | ||
|
||
$stacking-context-level-dropdown: 10000; |
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.
WDYT?
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.
It is ok now, however, I was wondering if 1000 would be enough.
Addresses: #337