IE 11 text selection in thead.

IE 11 text selection in thead.

ArmecArmec Posts: 3Questions: 1Answers: 0
edited January 2017 in Free community support

Hi!

During working with DataTables I noticed that in Internet Explorer 11 I'm unable to select text in thead. I thought it was my fault because I changed headers to individual column search input ( in which I wasn't able to select text and it's annoying) but it appears that DataTables is blocking text selection because even with zero configuration ( https://datatables.net/examples/basic_init/zero_configuration.html ) I can't select text in thead.
Using code found in http://stackoverflow.com/questions/2518421/jquery-find-events-handlers-registered-with-an-object I checked what event are on each th and noticed that there is "selectstart" event bind on them. After deleting this event with jQuery off() function I can select text in my input but I'm afraid it will somehow affect work of DataTables. Is there any reason to be concerned?

EDIT: I'm using DataTables 1.10.12

Answers

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    I don't understand what you mean by "...DataTables is blocking text selection".
    In the DataTables example you link to, there is nothing to be selected in thead.
    Can you explain the issue differently, preferably with your relevant code?

  • ArmecArmec Posts: 3Questions: 1Answers: 0

    Sorry if I said something wrong. English is not my mother tongue.

    By selecting text I mean something like in attached images.

    Also I found fragment of code in DataTables file that is responsible for that kind of behavior:

    function _fnBindAction( n, oData, fn )
    {
    $(n)
    .bind( 'click.DT', oData, function (e) {
    n.blur(); // Remove focus outline for mouse users
    fn(e);
    } )
    .bind( 'keypress.DT', oData, function (e){
    if ( e.which === 13 ) {
    e.preventDefault();
    fn(e);
    }
    } )
    .bind( 'selectstart.DT', function () {
    /* Take the brutal approach to cancelling text selection */
    return false;
    } );

    }

This discussion has been closed.