question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow ToggleWidgetValues to accept multiple values

See original GitHub issue

Do you want to request a feature or report a bug? feature

Feature: What is your use case for such a feature? I have an attribute I’d like to use a toggle widget for, but I’d like to have the “on” value be one of many options.

Feature: What is your proposed API entry? The new option to add? What is the behavior? I’d like to use it like this:

search.addWidget(instantsearch.widgets.toggle({
  container: '#toggle',
  attributeName: `hasMedia`,
  on: [true, 'true', 1, '1'],
}));

An alternate implementation might allow you to pass a fn with an argument of the value of the specified attr, returning a bool:

search.addWidget(instantsearch.widgets.toggle({
  container: '#toggle',
  attributeName: `hasMedia`,
  on: (value) => {
    return value && value !== 'off';
  },
}));

What is the version you are using? Always use the latest one before opening a bug issue. 1.11.12/2.beta-5

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
eunjae-leecommented, Jun 8, 2020

@Kocal It’s available@4.6.0. https://github.com/algolia/instantsearch.js/blob/master/CHANGELOG.md#460-2020-06-08

Thank you for your contribution 😃

1reaction
eunjae-leecommented, Jun 5, 2020

I’ll release this on Monday.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Correct way to pass multiple values for same parameter name ...
I'm looking into what is the correct way to pass multiple values for the same parameter name in a GET ...
Read more >
Multiple values—ArcGIS Pro | Documentation
Many geoprocessing tools have parameters that allow you to specify multiple values to be used in processing.
Read more >
Allow multiple values to be selected from 1 field - ServiceNow
Solved: Hello, I have a requirement to allow users to select multiple values within 1 field. For example, the field is called Select...
Read more >
Basic Question: Trying to Add Item to a "Multiple Values"
First, let me start with I have merely dabbled in simple Access databases, and am trying to stick with macros but open to...
Read more >
How to create a parameter prompt that accepts multiple values ...
Normally when a Parameter Query prompts for a parameter you can enter only one value. If you have a table for all customers...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found