List values are not displayed in the Inspector

I’m trying to edit list values in the Inspector.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TestObject : MonoBehaviour
{
    [SerializeField]
    private List<string> m_lName;

    // Start is called before the first frame update
    void Start()
    {
       
    }

    // Update is called once per frame
    void Update()
    {
       
    }
}

However, the result looks like the attached image.
Unable to set the value in the list.
7796037--984774--upload_2022-1-11_0-56-15.png

I want to know the reason of this problem.
How can I solve this problem?

Thanks.

Development Environment
Windows 10 Home ( Version 20H2 )
Unity 2021.2.7f1 Personal

Hello,

This looks like a bug to me. You can try reporting it to Unity at the top of your project via Help → Report a Bug…

However, you may want to try creating a new script to see if the issue persists. I’d also recommend using the latest LTS version if you want to avoid as many bugs as possible. The latest LTS version of Unity as of writing this is 2020.3.25f1

I tested your exact script in the latest LTS, and this is what it looks like for me, so I’m fairly certain you have a bug:
7796595--984885--Capture.JPG

Agreed.

For OP, some things to try:

  • right-click-reimport-all in your project

Or try other types of lists, like a list of ints, or a list of GameObjects, etc.

Thank you for getting back to me.

I tried the latest LTS version and it solved the problem.
I’m going to use the latest LTS version.
I’ve also reported a bug to Unity.
thanks for your help.

I have tried it but the result was the same.
Thank you very much anyway.