Skip to content

Commit 05d1d78

Browse files
committed
docs(combobox,command): cite Slint 1.16 string-method gap behind the v1 filter
I tried adding in-component substring filtering (visible + height collapse pattern, avoiding the `for x: if c: Element` syntax that doesn't compile in Slint 1.16). The blocker is the Slint string surface itself: `.to-lowercase()` works, but `.contains()` and `.starts-with()` are not present in 1.16 (only `is-empty` / `character-count` / `to-int` / `to-float` / case methods). Without a substring primitive there's no pure-Slint substring filter. Update both component comments so future readers (and a possible Slint upgrade pass) know exactly what unblocks the inline filter.
1 parent 52c74db commit 05d1d78

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

registry/default/components/combobox.slint

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,11 @@ export component Combobox inherits Rectangle {
7373
edited(_) => { root.highlighted-index = 0; }
7474
}
7575

76-
// Rows — derive `items` from `query` in the consumer; this
77-
// component just shows whatever you pass.
76+
// Rows — derive `items` from `query` in the consumer; Slint
77+
// 1.16 has no substring/prefix string methods, so in-component
78+
// filtering is blocked until Slint adds `contains` / `starts-
79+
// with`. The component otherwise wires the search field + the
80+
// selection + the keyboard contract cleanly.
7881
for item[idx] in root.items: Rectangle {
7982
height: 30px;
8083
border-radius: Tokens.radius-sm;

registry/default/components/command.slint

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ export component Command inherits Rectangle {
7676
edited(_) => { root.highlighted-index = 0; }
7777
}
7878

79-
// Rows — derive `items` from `query` in the consumer; this
80-
// component just shows whatever you pass.
79+
// Rows — derive `items` from `query` in the consumer; Slint 1.16
80+
// has no substring/prefix string methods, so in-component filtering
81+
// is blocked until Slint adds `contains` / `starts-with`.
8182
for item[i] in root.items: Rectangle {
8283
height: 38px;
8384
border-radius: Tokens.radius-sm;

0 commit comments

Comments
 (0)