-
Notifications
You must be signed in to change notification settings - Fork 118
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
Adding search feature to Select Component #265
Comments
Search Feature in Select Component Design Meeting ReportDate: 26.10.2022 15:30 (UTC+3)
Design work will start according to those decisions then implementation will be planned. |
Implementation details question : Will there be any count limit to separate in memory items flow from server side processing flow? This behaviour may be determined with a prop. Ex: Apply in memory items flow when item count is less than 100. |
We need to decide some details according to our update meeting. Here is the details;
@buseselvi FYI |
DesignImplementationGeneral usage example: <bl-select search-bar search-bar-placeholder="Search Country">
<bl-select-option value="tr">Turkey</bl-select-option>
<bl-select-option value="nl">Netherlands</bl-select-option>
</bl-select> RulesAPI Reference:
|
Attribute | Description | Default Value |
---|---|---|
label (string ) |
Sets the label value (optional) | - |
placeholder(string ) |
Sets the placeholder value. If left blank, the label value (if specified) is set as placeholder. (optional) | - |
size(string ) |
Sets the size value. Select component's height value will be changed accordingly (large, medium, small) | medium |
required (boolean ) |
When option is not selected, shows component in error state | false |
disabled (boolean ) |
Shows the component in disabled state | false |
multiple (boolean ) |
Allows multiple options to be selected | false |
label-fixed (boolean ) |
Makes label as fixed positioned | false |
help-text (string ) |
Adds help text(optional) | - |
invalid-text (string ) |
Set custom error message(optional) | - |
search-bar (boolean ) |
Show search text for options(optional) | - |
search-bar-placeholder (string ) |
Search text placeholder(optional) | - |
search-not-found-text (string ) |
When options not found, shown this text | Not Found |
search-bar-loading-state (boolean ) |
Search bar loading state for fetch request | false |
search-filterable (boolean ) |
Search in the option list | true |
Slots
Name | Description | Default Content |
---|---|---|
default slot |
Content inside select | - |
search-not-found slot |
Custom show search not found layout | - |
Events
Event | Description |
---|---|
bl-select |
Will be triggered when click option |
bl-search |
Will be triggered every time search bar key down |
In this issue we can focus search feature only. So you can remove unchanged attributes/events from the ADR. I would like to read some information about how search will work in some different use-cases. Can we add some code examples to the ADR?
Let's have a conclusion here first then continue implementation. That will be easier, I think. We can also arrange a meeting if it's needed. |
Design Meeting ReportDate: 2023-04-18 14:00 GMT+3 We had another discussion about this while talking about "Select All" feature (#520) Here are the search related decisions:
|
Our UX Research started on this together with #520. Results will come soon. |
Here is the final design documentation link 🚀 |
Searchable Select (ADR)Our aim is to add a simple search bar for our bl-select component. (Figma) StatusProposed Decision
Rationale<bl-select search-bar search-bar-placeholder="Search Country" search-bar-loading-state="false">
<bl-select-option value="tr">Turkey</bl-select-option>
<bl-select-option value="nl">Netherlands</bl-select-option>
<div slot="search-not-found">
<img src="https://cdn.trendyol.com/not-found-image" width="80" height="80"/>
<span class="no-result">No Result</span>
</div>
</bl-select>
ConsequencesLet's discuss this either under this comment or during our weekly meetings. |
Good job! Can you share your recommended solution to swap between the current behaviour of displaying selected options and the transformation after clicking to search among options? (like what's rendered before and after etc.) Additionally, I suggest avoiding the use of localized terms within components. Instead, consider employing slots to enable users to display their personalized messages. As we may introduce our own localization data in the future, the ability for developers to pass props might be deprecated. Therefore, utilizing slots provides flexibility for developers to render the content they prefer. |
Yes, I agree with you on that matter. Regarding our localization considerations, I believe the 'search-not-found' slot addresses it. However, for the placeholder, I think we can't resolve that using a slot since it needs to be within the input. |
Let's get a comment from @buseselvi about it. I personally preferring not to use a slot to have generic displaying. However, I think we can give a little bit flexibility after we successfully apply our decisions on that matter. |
Searchable Select (ADR)Our aim is to add a simple search bar for our bl-select component. (Figma) StatusAccepted Decision
Rationale<bl-select search-bar search-bar-placeholder="Search Country" search-bar-loading-state="false">
<bl-select-option value="tr">Turkey</bl-select-option>
<bl-select-option value="nl">Netherlands</bl-select-option>
</bl-select>
ConsequencesI have concerns regarding the default text for the clear search button, as it needs to be available in either Turkish or English. How should we address this? Having an empty button text could appear awkward and we need to ensure there is a default text for the button. |
Hello, we agreed not to use slots here 🚀 Also, I did a little research about the clear selected items and clear search we discussed. I couldn't find an example with clear search (for multiple select). So, let's not add a clear icon button to delete the text written in search and leave the clear button as it is (removing selected items). |
Closes #265 I've pushed the commit unverified as I'm facing operating system-related test errors on my local machine. Despite my efforts, I couldn't resolve the issue. I've opened an issue on [the relevant project](https://github.com/modernweb-dev/web) for further investigation. modernweb-dev/web#2589 --------- Co-authored-by: Erbil Nas <[email protected]> Co-authored-by: Ogun Babacan <[email protected]>
🎉 This issue has been resolved in version 2.4.0-beta.7 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Figma
We need to add searchable feature to our select component.
Details will be here...
The text was updated successfully, but these errors were encountered: