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.

select does not like options value containing raw numerical zero

See original GitHub issue

The input selector acts wiggy when you define it to have an option element that is the number 0.

For instance.

timeZones: [-11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],
timeZone: 0,

{{#power-select options=timeZones selected=timeZone searchEnabled=false onchange=(action (mut timeZone)) as |opt|}}
                    {{opt}}
{{/power-select}}

What happens is that the selection is not displayed if the selected is set to 0 and also when you scroll to the selection in the UI it auto-scrolls back to the top of the window.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
cibernoxcommented, May 10, 2016

yeah, I’m sure there is at least a couple places where I’m checking something like if (selectedOption) { do foo } where I should do if (selectedOption !== undefined) { do foo }.

In my opinion, 0, false and null are perfectly valid options. The only value that should represent the absence of an option, is undefined

2reactions
SirZachcommented, Oct 25, 2016

I can reproduce the same unselected behavior with false as the value

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation: 15: SELECT - PostgreSQL
All the selected rows are considered to form a single group, and the SELECT list and HAVING clause can only reference table columns...
Read more >
Functions, operators, and conditionals | BigQuery
This topic is a compilation of functions, operators, and conditional expressions. To learn more about how to call functions, function call rules, ...
Read more >
options: Options Settings - Rdrr.io
Invoking options() with no arguments returns a list with the current values of the options. Note that not all options listed below are...
Read more >
Excel: If cell contains formula examples - Ablebits
If a cell contains at least one of the specified substrings, there will be TRUE in the array. The double unary operator (--)...
Read more >
Extracting, transforming and selecting features - Apache Spark
Extracting, transforming and selecting features. This section covers algorithms for working with features, roughly divided into these groups:.
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