MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / handleClickOutside

Function handleClickOutside

web/pgadmin/static/js/QuickSearch/index.jsx:236–247  ·  view source on GitHub ↗

* Alert if clicked on outside of element

(event)

Source from the content-addressed store, hash-verified

234 * Alert if clicked on outside of element
235 */
236 function handleClickOutside(event) {
237 if (ref.current && !ref.current.contains(event.target)) {
238 let input_element = document.getElementById('live-search-field');
239 if(input_element == null){
240 return;
241 }
242 let input_value = input_element.value;
243 if(input_value && input_value.length > 0){
244 toggleDropdownMenu();
245 }
246 }
247 }
248 // Bind the event listener
249 document.addEventListener('mousedown', handleClickOutside);
250 return () => {

Callers

nothing calls this directly

Calls 1

toggleDropdownMenuFunction · 0.85

Tested by

no test coverage detected