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

Add multiline edition to listbox #158

Closed
brauliodiez opened this issue Aug 9, 2024 · 0 comments · Fixed by #201
Closed

Add multiline edition to listbox #158

brauliodiez opened this issue Aug 9, 2024 · 0 comments · Fixed by #201
Assignees

Comments

@brauliodiez
Copy link
Member

We have already created a listbox component:

image

And we've got multiline editing.

Let's say we want to have the following entries in the list:

Apple 
Microsoft
Meta
Google
Amazon

And mark as selected Meta

We expect to have the following inline edition in a text area:


Apple
Microsoft
[*]Meta
Google
Amazon

This should show the list of companies and show selected Meta.

Steps to do this:

  • Add the text property into the listbox rendered, set default data and bind it to the listbox text property in the TSX.

  • Create in common/utils a method that takes as entry point a strings and split it's in an array of strings (broken down by new line character), ... this method will be used in other components.

  • Add a state of type string[] (items) that will hold the list of strings inside the listbox component.

  • Bind this string[] (items) to the list of items to be shown.

  • Calculate the size of the text list (or add clipping) to avoid showing items that are outside of the available list box space.

  • Parse each string, if one starts with [*] mark it as selected (background color or blue rectangle).

  • In the ListBox shape implementation, check whether the text property changes and update a string[] field in the listbox

@brauliodiez brauliodiez moved this to Backlog in QuickMock Aug 9, 2024
@LourdesRsdp LourdesRsdp self-assigned this Aug 10, 2024
brauliodiez added a commit that referenced this issue Aug 15, 2024
…-to-listbox

Feature/#158 multiline edition to listbox
@github-project-automation github-project-automation bot moved this from In Review to Done in QuickMock Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants