Link field issue

if you enter a value in link field that is available in database but not available in filter it will accept that value and not clearing field…

please check this link to understand my issue.

https://github.com/frappe/frappe/issues/7235