UIDReferenceField Bug

Hi guys,
I want to create a sample but I have a problem when I try to load the contact assign to the client. on the first click, the contact dropdown shows all contacts in the system. On the second click, only contacts associated to the client appear. How can I fix this please? I think that this bug is due to latency time to load the data.
I know also that it’s an UIDReferenceField. Is it possible to restrict the field, like nothing will appears on click on the field if the client is not selected? Then, if a client is selected, the dropdown will show only the contact which is associeted to that client?