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.

Reorderable List Attribute breaks rendering with Property-Drawered properties

See original GitHub issue

While getting rid some old (Apr 21 2019) version of NaughtyAttributes I used in my Gameplay Ingredients package, I stumbled upon a break in the behavior of Reorderable List Attributes.

Reproduced with 2020.1.13f1 / current 2.0.7 (cloned your project to have a boilerplate project that’s vanilla)

Seems that Reorderable List property drawer sends incorrect Rect to custom property drawers

In this image : Range Float is broken in the Reorderable List (no Field) but SomeClass uses default PropertyField correctly image

In this Image I created a Custom Property Drawer for SomeClass fields: image

This PropertyField Custom property drawer is just a pass-through for a propertyfield :

using UnityEditor;

[CustomPropertyDrawer(typeof(SomeClass))]
public class SomeClassPropertyDrawer : PropertyDrawer
{
    public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    {
        EditorGUI.PropertyField(position, property);
    }
}

While debugging, seems that the Rect being sent has incorrect size (position seems correct but could be confirmed): image

I enclosed a repro-case unitypackage, not sure if it’s related to your drawer. Seems that old ReorderableList code did not repro this problem ( at least the one I use in my gameplay-ingredients package which is antique 😃 )

NaughtyAttributes-ReorderableListReproCase.zip

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dbrizovcommented, Dec 22, 2020

I merged the pull request into the v2 branch: f188911da9bd764d6538d3efdfea4f35bc518265

0reactions
dbrizovcommented, Dec 8, 2020

@peeweek Hey. Sorry for the delay dude, I will try to merge it in the upcoming weekend. I’m pretty busy these couple of months. I also have some other issues that I want to address and make a new release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to implement Reorderable List in custom ...
The ListView class has a "reorderable" attribute but ultimately it is made to render any number of elements in a scroll view with...
Read more >
How can I implement ReorderableList on a PropertyDrawer ...
1 Answer 1 ... After a short break I came back and tried something unusual. As it turns out if you put an...
Read more >
The greatest trick Unity ever pulled was convincing ...
I set up this object's editor script so the ReorderableList's add menu automatically populates itself, and so that the list draws each element ......
Read more >
ReorderableList.cs - Unity Technologies
RefreshInspectors; } } // class for default rendering and behavior of reorderable list - stores styles and is statically available as s_Defaults public ......
Read more >
Reorderable Lists and ordering arrays
To answer your question: the reorderable list component works exclusively through arrays, so you can provide an array you want to reorder and...
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