You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before selecting anything in the ComboBox, type 2024 very quickly (has to be quick to beat the debounce applying the change)
Should see ComboBox open showing all items for 2024
Clear the typing
Non-working Scenario
This time, type 2024 slowly so that the filter gets applied before you finish typing.
CombBox is no longer open
If you backspace the 4, ComboBox will open briefly then close. Typing 4 again will not re-open the ComboBox
If you backspace the 4 and type it again very quickly, it will re-open
fromdeephavenimportempty_table, ui, time_tableimportdatetimeinitial_row_count=5*8760# 5 years_items=time_table("PT6H", start_time=datetime.datetime.now() -datetime.timedelta(hours=initial_row_count)).update([])
key_column="Timestamp"@ui.componentdefui_combo_box(items):
value, set_value=ui.use_state()
combo=ui.combo_box(
items,
key_column=key_column,
label_column=key_column,
label=key_column,
on_selection_change=set_value,
selected_key=value,
)
# Show current selection in a ui.text componenttext=ui.text("Selection: "+str(value))
returncombo, textmy_combo_box=ui_combo_box(_items)
I believe the root cause is the Spectrum ComboBox only shows the popup after the user types and there are items in the source array. Changing from an empty items array to one with data won't open the popup until user types.
Here's the impact of this:
User types 202 which gets applied to the list and results in no matching results due to how our date filter works.
User types 4
ComboBox still has empty items, so it doesn't open even though user typed
We apply the filter to jsapi which results in items array containing all 2024 data. This updates the ComboBox, but it doesn't automatically open when items change, only when user types
User backspaces 4 slowly. This flickers for a moment the 2024 data since it still exists in items, but then 202 is applied as filter resulting in empty items array. ComboBox rightly closes due to empty data
Typing 4 again repeats the issue in step 3.
Backspacing 4 and retyping quickly opens because the filter resulting in empty items is never applied, and user has typed while there are still results in items
I'm not sure how to get around this but seems we need a way to force the ComboBox to open if the items array goes from empty to populated as a result of a user key stroke.
Note: Worth mentioning that there are 2 additional menuTrigger modes that change the behavior of the dropdown opening that will need to be accounted for in whatever solution we may find.
The text was updated successfully, but these errors were encountered:
Jsapi support for ComboBox. Includes some splitting out of existing
Picker logic to make code re-usable.
Should be testable with plugins PR
deephaven/deephaven-plugins#588
I have also deployed an alpha
[0.83.1-alpha-combobox.8](https://www.npmjs.com/package/@deephaven/components/v/0.83.1-alpha-combobox.8)
if you need it, although should only matter for types I think.
```python
from deephaven import empty_table, ui, time_table
import datetime
# Change this to test different data types
key_column="Timestamp"
initial_row_count=5 * 8760 # 5 years in hours
# Tick every 6 hours (makes it easier to test Timestamp filters for a whole day like `2024-01-02`)
_items = time_table("PT6H", start_time=datetime.datetime.now() - datetime.timedelta(hours=initial_row_count)).update([
# Timestamp column also implicitly included in `time_table`
"Int=new Integer(i)",
"Long=new Long(i)",
"BigInt=new java.math.BigInteger(``+i)",
"String=new String(`a`+i * 1000)",
])
@ui.component
def ui_combo_box(items):
value, set_value = ui.use_state("")
combo = ui.combo_box(
ui.item_table_source(
items,
key_column=key_column,
label_column=key_column,
),
label=key_column,
on_selection_change=set_value,
menu_trigger="focus",
selected_key=value,
)
# Show current selection in a ui.text component
text = ui.text("Selection: " + str(value))
return combo, text
my_combo_box = ui_combo_box(_items)
```
There is a known issue with inconsistent open as you type for table data
sources.
#2115resolves#2074
When searching for items in a ComboBox backed by a table data source, sometimes the picker opens to show results as you type. Sometimes it does not.
I've filed a bug with Spectrum to address the root cause: adobe/react-spectrum#6638Reproduction Steps
Run the below script
Working Scenario
2024
very quickly (has to be quick to beat the debounce applying the change)2024
Non-working Scenario
2024
slowly so that the filter gets applied before you finish typing.4
, ComboBox will open briefly then close. Typing4
again will not re-open the ComboBox4
and type it again very quickly, it will re-openI believe the root cause is the Spectrum ComboBox only shows the popup after the user types and there are items in the source array. Changing from an empty items array to one with data won't open the popup until user types.
Here's the impact of this:
202
which gets applied to the list and results in no matching results due to how our date filter works.4
4
slowly. This flickers for a moment the2024
data since it still exists in items, but then202
is applied as filter resulting in empty items array. ComboBox rightly closes due to empty data4
again repeats the issue in step 3.4
and retyping quickly opens because the filter resulting in empty items is never applied, and user has typed while there are still results in itemsI'm not sure how to get around this but seems we need a way to force the ComboBox to open if the items array goes from empty to populated as a result of a user key stroke.
Note: Worth mentioning that there are 2 additional
menuTrigger
modes that change the behavior of the dropdown opening that will need to be accounted for in whatever solution we may find.The text was updated successfully, but these errors were encountered: