Search Unity

Delayed field's ChangeEvent not firing (ListView interaction issue)

Discussion in 'UI Toolkit' started by Lance-Grooms, Apr 26, 2020.

  1. Lance-Grooms

    Lance-Grooms

    Joined:
    Mar 24, 2016
    Posts:
    26
    Here is what I'm trying to do:
    upload_2020-4-26_11-29-45.png

    On the left is a list view. On the right is a panel that binds data based on the list selection. I'm using delayed update fields on the right (MyField.isDelayed = true). It all works great except for one issue:

    When changing the list selection (on left) with a delayed field still focused (on right), the callback (RegisterCallback<ChangeEvent<T>>) never fires despite it losing focus (to the ListView). In this case, an edited value never gets updated before switching objects and the edit changes are lost.

    Note: I am using custom binding here, because these are non-unity objects (in case that is relevant). I've tried various hacky approaches including forcing a Blur(), but can't find an elegant work-around. Any ideas?
     

    Attached Files: