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

Improve behaviour when clicking on tagger. #37

Merged
merged 2 commits into from
Aug 26, 2014

Conversation

benbasson
Copy link
Member

Clicking on any area of whitespace within the tagger, including the
input field, will now trigger the suggestion list in both single and
multi select mode. In single-select mode, clicking on the selected tag
will also trigger the suggestion list.

When clearing the selected tag in single-select mode via the (x), the
suggestions list remain open if it is currently open, and the filter
value (if there is one) will be moved to the main input so that
filtering can continue seamlessly.

Solves #10.

Clicking on any area of whitespace within the tagger, including the
input field, will now trigger the suggestion list in both single and
multi select mode. In single-select mode, clicking on the selected tag
will also trigger the suggestion list.

When clearing the selected tag in single-select mode via the (x), the
suggestions list remain open if it is currently open, and the filter
value (if there is one) will be moved to the main input so that
filtering can continue seamlessly.
@Palmr
Copy link
Contributor

Palmr commented Aug 24, 2014

Is it a good idea to show the full unfiltered list on click?
Isn't it a potentially heavy operation, and how does this play with the characterThreshold option? Should this not perhaps be an option for when characterThreshold is set to 0? Or could we make this perform better by only loading the first 100 items in the suggestion list and then lazy-loading the next 100 when people scroll down to them?

@benbasson
Copy link
Member Author

You make a good point, but it's ultimately doing the same thing as pressing the dropdown arrow (loading up to 300 immediately if not already initialised). I guess it does make it slightly worse because it removes the opportunity to filter before the list is shown.

We should do something along the lines of your latter suggestion and load fewer items initially. I was planning to take a look at the logic around that stuff in a follow-up set of changes anyway. I'm not a big fan of pseudo-infinite scrolling, but we could certainly load the list in a more deliberately async way.

@benbasson
Copy link
Member Author

I've filed #38, #39 and #40 to look at a few areas of performance.

I'll update this pull request to disable the functionality for multi-select and single-select taggers where no value has yet been chosen (for now).

My main goal currently is to allow users to click on a single-select tagger and have the menu drop-down, which achieves feature parity with native HTML select widgets. This essentially just extends the hit target from the drop-down arrow only to the whole widget if a value has already been selected.

For performance reasons, only display the suggestions list if we click
on the tagger and it has a single value selected (in single value mode).
Functionality to display the suggestion menu on click may be restored
later for multi select or single-select with no value when performance
of generating the suggestion list has been improved.
@benbasson
Copy link
Member Author

@Palmr - pull request updated as above.

Palmr added a commit that referenced this pull request Aug 26, 2014
Improve behaviour when clicking on tagger.
@Palmr Palmr merged commit 5f4e3df into Fivium:master Aug 26, 2014
@benbasson benbasson deleted the click-to-show-dropdown branch August 26, 2014 21:23
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.

2 participants