Search code examples
jqueryhtmlcssjquery-select2handsontable

Select2 Dropown in Handsontable goes out of layout/cell


Please check the fiddle at http://jsfiddle.net/rajivseelam/zfmdu4wt/5/

I am using select2 3.5.2 and handsontable latest.

To add select2 dropdown to handsontable, I used plugin at https://github.com/trebuchetty/Handsontable-select2-editor

Steps to see the issue:

  1. Click on an empty cell under Cost column, it shows a dropdown with options fixed and variable.enter image description here

  2. Click again on the same cell, it shows dropdown but it goes out of cell.enter image description here

The following control the dropdown in handsontable:

        {
          data: 'cost',
          editor: 'select2', 
          renderer: customDropdownRenderer,
          select2Options: { 
                  data: [{id:'fixed',text:'Fixed'},{id:'variable',text:'Variable'}] ,
                  dropdownAutoWidth: true,
          }
        },

I have been trying to fix this problem, but I couldn't. Any help would be appreciated.


Solution

  • Try commenting the following line this.$textarea.offset($(this.TD).offset()); in the select2-editor.js (Select2Editor.prototype.open function)