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

feat(select): add multiple option to limel-select #350

Closed
wants to merge 3 commits into from

Conversation

adrianschmidt
Copy link
Collaborator

fix #203

@adrianschmidt adrianschmidt added the feature New feature or request label Apr 1, 2019
@adrianschmidt adrianschmidt self-assigned this Apr 1, 2019
@ghost ghost added the review label Apr 1, 2019
@jgroth jgroth self-requested a review April 1, 2019 10:17
@adrianschmidt adrianschmidt force-pushed the multiple-option-for-select branch 2 times, most recently from 1f7fd41 to b50470f Compare April 1, 2019 12:07
…multi-select

BREAKING CHANGE: `limel-multi-select` has been removed.
Use `limel-select` with the `multiple` attribute instead.

fix #203
.map(option => {
return option.text;
})
.join(', ')
Copy link
Contributor

Choose a reason for hiding this comment

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

This would be more readable if it was refactored into a function, e.g. getHeader

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will do.

);
}

private renderCheckbox(index: number, option: Option) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should try to reuse as much code as possible and there seem to be a lot of similarities between this and both the checkbox and list components. Can we not reuse those instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is just a straight copy-paste from the old limel-multi-select. Of course we should improve on it in future iterations, but we needed something quick to make the add-new dialog in the webclient releasable. Perfect is the enemy of good.

public render() {
return (
<div class="multi-select">
<limel-collapsible-section
Copy link
Contributor

Choose a reason for hiding this comment

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

Did it seem to be a lot of work to get this working with limel-menu instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The menu kept closing when anything was clicked and I couldn't find an immediate solution so I went with something I could finish before going on vacation.

@@ -34,93 +40,41 @@ export class Select {
@Element()
private limelSelect: HTMLElement;
Copy link
Contributor

Choose a reason for hiding this comment

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

This one is no longer in use

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

shadow: true,
styleUrl: 'select-multiple.scss',
})
export class SelectMultiple {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this component and SelectSingle are "internal" and should not be used anywhere else, maybe we could move them to a subfolder of select if Stencil allows that without complaining

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Stencil tends to complain. I haven't tried it. I'm going on vacation for almost two weeks in a while, but you are welcome to try it.

@hannahu hannahu closed this Apr 5, 2019
@ghost ghost removed the review label Apr 5, 2019
@adrianschmidt adrianschmidt deleted the multiple-option-for-select branch July 29, 2019 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[PRIO] Limel-multi-select: hide options behind a trigger
3 participants