Fixed #2509

Added a check if an input field is a descendant of the current li