On Setup Tab How can I change values, Scrolls to Top

Zaddo

Active member
I have an annoying problem, I can't change values on the Setup tab. The window automatically scrolls to the top when I try to drag an item onto a property. I try to use the scroll mouse while dragging to move the window back down, but this does not work.

 
I have an annoying problem, I can't change values on the Setup tab. The window automatically scrolls to the top when I try to drag an item onto a property. I try to use the scroll mouse while dragging to move the window back down, but this does not work.


I found a workaround. I search for UIDesignerSchema in my project and locate the scriptable object. Then change the values directly on this object.
 
Thank you for bringing this to my attention and showing a workaround. I'll add it to the list of things to fix
 
If you are in a rush for a fix, before Sangemdoko puts out his fix. This worked for me, but there is a slight chance this change might block some necessary editor refresh. There are only a couple of lines changed, but I have included the existing code from the methods to save any confusion.


C#:
// These changes are to UIDesignerManager

// Create a Class Variable
protected bool m_tabChanged = true;

// Change the refresh method to this
        public override void Refresh()
        {
            base.Refresh();

            //In case it refreshes while the code is compiling stop before null exception.
            if (m_Builders == null) { return; }

            var result = IsSetupValid();
            m_UIDesignerValidationResult = result;

            var enable = result.validationState != UIDesignerSchema.ValidationState.HasErrors;
            for (int i = 1; i < m_Builders.Count; i++) {
                m_Toolbar.EnableButton(i, enable);
            }

            if (enable == false) {
                m_Toolbar.Selected = 0;
                m_Builders[0].Refresh();
                ChangeTab(0);
                return;
            }

            // Only refresh pages if the Tab has changed
            if (!m_tabChanged) return;
            m_tabChanged = false;

            for (int i = 0; i < m_Builders.Count; i++) {
                m_Builders[i].Refresh();
            }
        }

// Change ChangeTab method to
        public void ChangeTab(int index)
        {
            m_Container.Clear();

            if (index < 0 || index >= m_Builders.Count) { return; }

            EditorPrefs.SetInt(UIBuilderTabIndexKey, index);
            m_Container.Add(m_Builders[index]);

            m_Builders[index].Refresh();

            if (m_Toolbar.Selected != index) {
                m_Toolbar.Selected = index;
                m_tabChanged = true;
            }
        }
 
Top