import { canUseDOM } from "../../../utils";
export const selectText = (node)=>{
    if (!canUseDOM) {
        return;
    }
    setTimeout(()=>{
        const body = document.body;
        if (window.getSelection && document.createRange) {
            const range = document.createRange();
            range.selectNodeContents(node);
            const selection = window.getSelection();
            selection?.removeAllRanges();
            selection?.addRange(range);
        } else if (body.createTextRange) {
            const range = body.createTextRange();
            range.moveToElementText(node);
            range.select();
        }
    });
};
