Avasccript-How-to-Detect-if-a-Word-Highlighed

export const isHighlighting = () => {
  // detects mouse is highlighting a text
  return window.getSelection && window.getSelection().type === 'Range';
};
Borma