Editor Popup window keeps resetting

I’ve created a custom editor pop up bar. However the selection I pick keeps resetting each time I select a different game object.

Can someone please take a look over my code to see where it keeps getting reset and how I can stop this from happening? The data I input stays there, it’s more a convenience thing that I want option I select to stay open when I come back to the editor window.

	string[] analytic_Options = {"None", "Button Press"};
	private int analytic_Index = 0;

public override void OnInspectorGUI()
	{
		GUILayout.BeginVertical();
		GUILayout.Space(10);
		analytic_Index = EditorGUILayout.Popup(analytic_Index, analytic_Options);

		UpdateEditorGUI();

		GUILayout.Space(10);
		GUILayout.EndVertical();

	}

void UpdateEditorGUI()
	{
		switch(analytic_Index)
		{
		case 0:			// No analytics selected
			break;
		case 1:			// Button analytic info

		
			string name_HolderString = EditorGUILayout.TextField("Event Category", target_Object.button_NameString);
			if(target_Object.button_NameString != name_HolderString)
			{
				button_EventNameString = name_HolderString;
				target_Object.button_NameString = name_HolderString;
			}
			
			string action_HolderString = EditorGUILayout.TextField("Event Action", target_Object.button_ActionString);
			if(target_Object.button_ActionString != action_HolderString)
			{
				button_EventActionString = action_HolderString;
				target_Object.button_ActionString = action_HolderString;
			}
			
			string label_HolderString = EditorGUILayout.TextField("Event Label", target_Object.button_LabelString);
			if(target_Object.button_LabelString != label_HolderString)
			{
				button_EventLabelString = label_HolderString;
				target_Object.button_LabelString = label_HolderString;
			}
			break;
		
		}

It derives from Editor?

Therefore it’s destroyed and recreated every times you select a different object to be inspected. Any non-static variable are also destroyed and re-initialized every times.

private static string[] analytic_Options = {"None", "Button Press"};
private static int analytic_Index = 0;

of course, makes perfect sense. Thank you.