Primitives · a raise keeps its state under its owner's id
A raise inside another was namespaced by its place in the layer's queue, so one that came before it moved its id path and rebuilt its keyed state and focus: an open date popup would lose its month when a tip appeared. raise now takes its owner's id and draws under it, and float and float_height pass the owner's id on from every call site. A test holds a focused box in a raise while another comes before it.
This commit is contained in:
1 parent
341420d1e4
commit
51ade29032
25 files changed
+188
-40
No files matched your search
@@ -228,6 +228,7 @@ fn period_picker(
|
||||
};
|
||||
let grid = period_grid(&key, build(shown), grid, window, cx);
|
||||
float(
|
||||
key.clone(),
|
||||
anchor,
|
||||
6,
|
||||
surface((key.clone(), "popup"), cx)
|
||||
|
||||
@@ -246,6 +246,7 @@ impl RenderOnce for DatePicker {
|
||||
}
|
||||
let (escape, done) = (close.clone(), close.clone());
|
||||
float(
|
||||
id.clone(),
|
||||
anchor,
|
||||
CALENDAR_ROWS,
|
||||
surface((id.clone(), "popup"), cx)
|
||||
@@ -347,6 +348,7 @@ impl RenderOnce for DateRangePicker {
|
||||
}
|
||||
let (hover, pick, escape) = (state.clone(), state.clone(), close.clone());
|
||||
float(
|
||||
id.clone(),
|
||||
anchor,
|
||||
CALENDAR_ROWS,
|
||||
surface((id.clone(), "popup"), cx)
|
||||
|
||||
@@ -256,6 +256,7 @@ impl RenderOnce for TimePicker {
|
||||
let columns = time_columns(&id, time, step, commit.clone(), window, cx);
|
||||
let out = close.clone();
|
||||
float(
|
||||
id.clone(),
|
||||
anchor,
|
||||
CALENDAR_ROWS,
|
||||
surface((id.clone(), "popup"), cx)
|
||||
@@ -368,6 +369,7 @@ impl RenderOnce for DateTimePicker {
|
||||
);
|
||||
let out = close.clone();
|
||||
float(
|
||||
id.clone(),
|
||||
anchor,
|
||||
CALENDAR_ROWS,
|
||||
surface((id.clone(), "popup"), cx)
|
||||
|
||||
@@ -77,6 +77,7 @@ impl RenderOnce for WeekPicker {
|
||||
}
|
||||
let (escape, out, on_change) = (close.clone(), close.clone(), on_change.clone());
|
||||
float(
|
||||
id.clone(),
|
||||
anchor,
|
||||
CALENDAR_ROWS,
|
||||
surface((id.clone(), "popup"), cx)
|
||||
|
||||
Reference in new issue
Block a user