Skip to content
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

Merged
merged 4 commits into from
Jul 8, 2022
Merged

Improvements for Picker component #336

merged 4 commits into from
Jul 8, 2022

Conversation

marcinsawicki
Copy link
Contributor

@marcinsawicki marcinsawicki commented Jul 1, 2022

Addresses: #337

@marcinsawicki marcinsawicki added bug Something isn't working feature New feature or request labels Jul 1, 2022
@marcinsawicki marcinsawicki added this to the v1.0.0 milestone Jul 1, 2022
if (!disabledSearch) {
document.removeEventListener('keydown', onKeyDown);
}
};
}, []);
Copy link
Contributor

@MichalPaszowski MichalPaszowski Jul 1, 2022

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;
Copy link

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;
Copy link

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;
Copy link

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

Copy link

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

Copy link

@sgraczyk sgraczyk left a 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.

@sgraczyk sgraczyk changed the title DS-213 - Improvements for Picker component Improvements for Picker component Jul 1, 2022
@@ -14,7 +14,7 @@ const baseClass = 'picker-trigger';
export type TriggerSize = 'compact' | 'medium' | 'large';

export interface ITriggerProps {
disabledSearch: boolean;
isSearchDisabled: boolean;
Copy link
Contributor Author

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.

Copy link

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

Comment on lines +1 to +5
/**
* Definition of z-index values to be used across application.
*/

$stacking-context-level-dropdown: 10000;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT?

Copy link

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.

@marcinsawicki marcinsawicki merged commit 39fcca4 into v1 Jul 8, 2022
@marcinsawicki marcinsawicki deleted the DS-213 branch July 8, 2022 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Picker] Improvements (default selected option, search input disabling, z-index , and border-box)
3 participants