question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] AtomBaseReferenceDrawer fails if the reference is in a List

See original GitHub issue

Describe the bug

When stored in a list, the reference drawer will exhibit strange behavior.

  1. clicking on the kebab menu will open the menu normally, but on selection a drag-event will have been started on the list item. This drag event does not stop until a different object is selected in the inspector

image

  1. sometimes (probably due to the same effect) one of the references in the list becomes invisible

image

  1. sometimes while the object reference field is visible, clicking on it has no effect

All these problems last until a different object is selected. Folding the list field does not resolve it. Folding the behaviour inspector doesn’t either.

To Reproduce Steps to reproduce the behavior:

  1. create a script with [SerializeField] List<FloatReference> inputs;
  2. Open the script inspector in unity
  3. Add a new list item
  4. Click ⁝
  5. Move mouse

Expected behavior Clicking on the kebab menu should just work

Environment

  • OS: Windows
  • Unity Version: 2022.2.4f1
  • Version of Unity Atoms: 4.4.5

Issue Analytics

  • State:closed
  • Created 7 months ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
lgarczyncommented, Apr 25, 2023

This appears to be due to a hotControl issue.

It appears that using the custom styles on the kebab menu breaks the Popup event handling system.

Unity Atoms should try to set a hotControl id when opening the popup, or use a different type of menu, such as a context menu maybe.

You can detect clicks by hand using this type of calls

      // Don't capture event if array drag/drop is active
      if (GUIUtility.hotControl != 0) return;
      if (Event.current.type == EventType.MouseDown
          && Event.current.button == 0
          && GUILayoutUtility.GetLastRect().Contains(Event.current.mousePosition))
      {
        DrawModifierContextMenu(modifier);
        Event.current.Use();
      }
0reactions
lgarczyncommented, May 29, 2023

Confirmed fixed on 2022.2.21

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unresolved references with list in Python
Suddenly, a problem occurs where it says that a_list on line 2 is an unresolved reference. Why should what is in the if...
Read more >
Problems in Generating the Reference List with TexMaker
The problem is that you can not use spaces in bibliography filenames, because BibTeX doesn't recognize them as valid characters.
Read more >
List.Count: object reference not set to an instance...
Hello everyone, I wrote this script but there is an error in the console(NullReferenceException: Object reference not set to an instance of ......
Read more >
CSCvn97029 - Failed in getting list of recordings when ...
Symptom: Failed in getting list of recordings when playback recording Conditions: When playback recording after encryption by encryption tool on existed ...
Read more >
Am I hitting a compiler bug?
The code itself represents the code structure from one of my real code bases which emits a compile time error, which I cannot...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found