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

Adds and updates SearchList #604

Closed
wants to merge 48 commits into from

Conversation

daRasmussen
Copy link
Contributor

Fixes #463

@daRasmussen daRasmussen mentioned this pull request Apr 16, 2019
@daRasmussen
Copy link
Contributor Author

config file

Replace the attributes of for example editor point with:

"attributes": [
        {
          "name": "sprak",
          "title": "Språk: ",
          "type": "searchList",
          "list": [
            {
              "value": "Java"
            },
            {
              "value": "JavaScript"
            },
            {
              "value": "Python"
            },
            {
              "value": "Ada"
            },
            {
              "value": "English"
            },
            {
              "value": "French"
            },
            {
              "value": "Swedish"
            }
          ],
          "config": {
            "minChars": 2,
            "maxItems": 15
          }
        },
        {
          "name": "icons",
          "title": "Ikoner: ",
          "type": "searchList",
          "list": [
            {
              "src": "img/kompass.svg",
              "value": "Riktning"
            },
            {
              "src": "img/geolocation_marker.png",
              "value": "Markör"
            },
            {
              "src": "img/geolocation_marker_heading.png",
              "value": "Rubrik"
            }
          ],
          "config": {
            "minChars": 0,
            "maxItems": 5
          }
        },
        {
          "name": "icon-lib",
          "title": "Bibliotek: ",
          "type": "searchList",
          "list": [
            {
              "location": "img/png",
              "extension": "png"
            },
            {
              "location": "img/png",
              "extension": "png"
            }
          ],
          "config": {
            "minChars": 0,
            "maxItems": 5
          }
        },
        {
          "name": "name",
          "title": "Name: ",
          "type": "text",
          "maxLength": 50
        },
        {
          "name": "type",
          "title": "Type: ",
          "type": "dropdown",
          "maxLength": 30,
          "options": [
            "Restaurant",
            "Café",
            "B&B"
          ]
        },
        {
          "name": "comments",
          "title": "Comments: ",
          "type": "textarea",
          "textarea": 254
        }
      ]

@tonnyandersson
Copy link
Collaborator

I'm getting some serious css errors.

image

@daRasmussen
Copy link
Contributor Author

@tonnyandersson Tnx I will look into that.

@daRasmussen
Copy link
Contributor Author

Update complete!

@tonnyandersson
Copy link
Collaborator

Looks better. But I'm not sure how this is supposed to work. For example, is this an expected behaviour?

image

The filter function seems to return all objects on the list, even if the input string is not in "src" or "value".

This is what happens when setting "minChars" to 0 or 1. Setting "minChars" to 2 works better but decreases sensitivity, obviously.

@daRasmussen
Copy link
Contributor Author

@tonnyandersson Yes it's expected behavior, the user should be prompted with available options. If you would rather not get a list of all possible items, then you should not use this option, its not mandatory. If Min-/ Max- chars params does not satisfy you needs, feel free to submit an ISSUE/PR.

@tonnyandersson
Copy link
Collaborator

When entering a letter or string into the search box, I expect the list to show all items containing that letter/string. If none of the items contain the specific letter/string, I would expect the list to be empty.

For example, now if I enter the letter "w" into the search box, the list shows all available options, which is not what I had expected. However, if I go on and enter "ww", the list shows up empty, which is totally in line with my expectations. Makes no sense to me.

@jokd
Copy link
Contributor

jokd commented Jul 10, 2019

@daRasmussen I agree with @tonnyandersson regarding the expected behaviour when you type a letter thats not part of any option, the list should be empty. Not showing everything.
Besides that, it looks nice.

@daRasmussen
Copy link
Contributor Author

@jokd will do

@daRasmussen daRasmussen self-assigned this Jan 20, 2020
@tonnyandersson
Copy link
Collaborator

Still has that weird filtering behaviour mentioned previously.

@daRasmussen daRasmussen mentioned this pull request Oct 2, 2020
@daRasmussen
Copy link
Contributor Author

Closing this due to merge conflicts, see updated PR #1005

@daRasmussen daRasmussen closed this Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search list
6 participants