### Godot version

4.1.dev (4d5f10fc3a)

### System information

MacOS 13.1 M1 Pro

### Issue description

When right clicking an element of an array/dictionary it will select it but it will never be unselected (not if you select another node nor by reselecting the node). This leads to a lot of element being marked as selected which makes it a little less readable. When doing a left click it won't select.

### Steps to reproduce

1. export an array 
2. add an element 
3. try left click it won't select
4. try right click it will select

### Minimal reproduction project

N/A
for (int i = p_element_index; i < count - 1; i++) {
						undo_redo->add_do_method(object, swap_method, i, i + 1);
					}
					for (int i = count; i > p_element_index; i--) {
						undo_redo->add_undo_method(object, swap_method, i, i - 1);
					}
					String erase_prefix = String(array_element_prefix) + itos(p_element_index);
					for (const PropertyInfo &E : object_property_list) {
						if (E.name.begins_with(erase_prefix)) {
							undo_redo->add_undo_property(object, E.name, object->get(E.name));
						}
					}
					undo_redo->add_do_property(object, count_property, count - 1);
				}
			} else {
				if (p_to_pos > p_element_index) {
					p_to_pos--;
				}
				if (p_to_pos < p_element_index) {
					for (int i = p_element_index; i > p_to_pos; i--) {
						undo_redo->add_do_method(object, swap_method, i, i - 1);
					}
					for (int i = p_to_pos; i < p_element_index; i++) {
						undo_redo->add_undo_method(object, swap_method, i, i + 1);
					}
				} else if (p_to_pos > p_element_index) {
					for (int i = p_element_index; i < p_to_pos; i++) {
						undo_redo->add_do_method(object, swap_method, i, i + 1);
					}
					for (int i = p_to_pos; i > p_element_index; i--) {