<commit_before>export default class Edit{
    constructor(editor, cell, onRendered, success, cancel, editorParams){
        this.edit = editor;
        this.table = editor.table;
        this.cell = cell;
        this.params = editorParams;
        
        this.data = [];
        
        this.input = this._createInputElement();
        this.listEl = this._createListElement();
        
        this.values = []; 
        this.popup = null;  
        
        this.blurable = true;
        
        this.actions = {
            success:success,
            cancel:cancel
        }
        
        onRendered(this._onRendered.bind(this));
    }
    
    _onRendered(){
        this.input.style.height = "100%";
        this.input.focus({preventScroll: true});
    }
    
    _createListElement(){
        var listEl = document.createElement("div");
        listEl.classList.add("tabulator-edit-select-list");
        
        listEl.style.minWidth = this.cell.getElement().offsetWidth + "px";
        
        listEl.addEventListener("mousedown", this._preventBlur.bind(this));
        
        return listEl;
    }
    
    _createInputElement(){
        var attribs = this.params.elementAttributes;
        var input = document.createElement("input");
        
        input.setAttribute("type", this.params.clearable ? "search" : "text");
        
        input.style.padding = "4px";
        input.style.width = "100%";
        input.style.boxSizing = "border-box";
        
        if(attribs && typeof attribs == "object"){
            for (let key in attribs){
                if(key.charAt(0) == "+"){
                    key = key.slice(1);
                    input.setAttribute(key, input.getAttribute(key) + attribs["+" + key]);
                }else{
                    input.setAttribute(key, attribs[key]);
                }<commit_msg>prevent long click causing list to dissapear<commit_after>export default class Edit{
    constructor(editor, cell, onRendered, success, cancel, editorParams){
        this.edit = editor;
        this.table = editor.table;
        this.cell = cell;
        this.params = editorParams;
        
        this.data = [];
        
        this.input = this._createInputElement();
        this.listEl = this._createListElement();
        
        this.values = []; 
        this.popup = null;  
        
        this.blurable = true;
        
        this.actions = {
            success:success,
            cancel:cancel
        }
        
        onRendered(this._onRendered.bind(this));
    }
    
    _onRendered(){
        var cellEl = this.cell.getElement();

        function clickStop(e){
            e.stopPropagation();
        }

        this.input.style.height = "100%";
        this.input.focus({preventScroll: true});

        
        cellEl.addEventListener("click", clickStop);
        
        setTimeout(() => {
            cellEl.removeEventListener("click", clickStop);
        }, 1000)
    }
    
    _createListElement(){
        var listEl = document.createElement("div");
        listEl.classList.add("tabulator-edit-select-list");
        
        listEl.style.minWidth = this.cell.getElement().offsetWidth + "px";
        
        listEl.addEventListener("mousedown", this._preventBlur.bind(this));
        
        return listEl;
    }
    
    _createInputElement(){
        var attribs = this.params.elementAttributes;
        var input = document.createElement("input");
        
        input.setAttribute("type", this.params.clearable ? "search" : "text");
        
        input.style.padding = "4px";
        input.style.width = "100%";
        input.style.boxSizing = "border-box";
        
        if(attribs && typeof attribs == "object"){
            for (let key in attribs){
                if(key.charAt(0) == "+"){
                    key = key.slice(1);
                    input.setAttribute(key, input.getAttribute(key) + attribs["+" + key]);
                }else{
                    input.setAttribute(key, attribs[key]);
                }
{'fraction_non_alphanumeric': 0.12555720653789004, 'fraction_numerical': 0.005448241703813769, 'mean_word_length': 1.6962616822429906, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '636574', 'n_tokens_mistral': 1133, 'n_tokens_neox': 1108, 'n_words': 188}