[Concept,13/22] expo: Fix textline edit text not updating in bootflow menu

Message ID 20251207201628.2882382-14-sjg@u-boot.org
State New
Headers
Series expo: Expand docs, dump and textlines in non-popup expos |

Commit Message

Simon Glass Dec. 7, 2025, 8:16 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

The edit text object for the passphrase textline is created with an
empty string literal "", rather than pointing to the textline's buffer.
This means that when the user types, tline->buf is updated but the text
object still displays the original empty string.

Fix this by creating the edit text object with abuf_data(&tline->buf) so
it points to the textline's buffer. This matches how expo_build.c
creates textlines for cedit.

Co-developed-by: Claude <claude@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 boot/bootflow_menu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/boot/bootflow_menu.c b/boot/bootflow_menu.c
index 84ae0223ba0..ee3150afef4 100644
--- a/boot/bootflow_menu.c
+++ b/boot/bootflow_menu.c
@@ -308,7 +308,7 @@  int bootflow_menu_add(struct expo *exp, struct bootflow *bflow, int seq,
 
 	snprintf(name, sizeof(name), "item%d.pass.edit", seq);
 	ret = scene_txt_str(scn, name, ITEM_PASS_EDIT + seq, 0,
-			    "", NULL);
+			    abuf_data(&tline->buf), NULL);
 	if (ret < 0)
 		return log_msg_ret("ite", -EINVAL);
 	tline->edit_id = ret;