How to use the select function in select

To help you get started, we’ve selected a few select examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zenorocha / clipboard.js / src / clipboard-action.js View on Github external
this.fakeElem.style.border = '0';
        this.fakeElem.style.padding = '0';
        this.fakeElem.style.margin = '0';
        // Move element out of screen horizontally
        this.fakeElem.style.position = 'absolute';
        this.fakeElem.style[ isRTL ? 'right' : 'left' ] = '-9999px';
        // Move element to the same position vertically
        let yPosition = window.pageYOffset || document.documentElement.scrollTop;
        this.fakeElem.style.top = `${yPosition}px`;

        this.fakeElem.setAttribute('readonly', '');
        this.fakeElem.value = this.text;

        this.container.appendChild(this.fakeElem);

        this.selectedText = select(this.fakeElem);
        this.copyText();
    }
github abhishekbalam / keeplinkin / keeplinkin / static / js / clipboard.js-master / src / clipboard-action.js View on Github external
this.fakeElem.style.border = '0';
        this.fakeElem.style.padding = '0';
        this.fakeElem.style.margin = '0';
        // Move element out of screen horizontally
        this.fakeElem.style.position = 'absolute';
        this.fakeElem.style[ isRTL ? 'right' : 'left' ] = '-9999px';
        // Move element to the same position vertically
        let yPosition = window.pageYOffset || document.documentElement.scrollTop;
        this.fakeElem.style.top = `${yPosition}px`;

        this.fakeElem.setAttribute('readonly', '');
        this.fakeElem.value = this.text;

        this.container.appendChild(this.fakeElem);

        this.selectedText = select(this.fakeElem);
        this.copyText();
    }
github decidim / decidim / decidim-core / app / packs / src / decidim / clipboard.js View on Github external
$(document).on("click", "[data-clipboard-copy]", (ev) => {
    const $el = $(ev.target);
    if (!$el.data("clipboard-copy") || $el.data("clipboard-copy").length < 1) {
      return;
    }

    const $input = $($el.data("clipboard-copy"));
    if ($input.length < 1 || !$input.is("input, textarea, select")) {
      return;
    }

    // Get the available text to clipboard.
    const selectedText = select($input[0]);
    if (!selectedText || selectedText.length < 1) {
      return;
    }

    // Move the selected text to clipboard.
    const $temp = $(`<textarea>${selectedText}</textarea>`).css({
      width: 1,
      height: 1
    });
    $el.after($temp);
    $temp.select();

    const copyDone = () =&gt; {
      $temp.remove();
      $el.focus();
    };
github zenorocha / clipboard.js / src / clipboard-action.js View on Github external
selectTarget() {
        this.selectedText = select(this.target);
        this.copyText();
    }
github catarse / catarse.js / legacy / src / c / copy-text-input.js View on Github external
el.onclick = () => {
                    select(textarea);
                    copy = document.execCommand('copy');
                    if (copy) {
                        showSuccess(true);
                        m.redraw();
                    } else {
                        textarea.blur();
                    }
                    return false;
                };
            }
github zjuasmn / sketch-react / src / components / Document / LayerInfo.js View on Github external
            <a> select(document.getElementById('code'))} style={{
              float: 'right',</a>

select

Programmatically select the text of a HTML element

MIT
Latest version published 8 years ago

Package Health Score

65 / 100
Full package analysis