1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Problem with xenforos autoselect function and long texts

Discussion in 'Resolved Bug Reports' started by ragtek, Jul 23, 2012.

  1. ragtek

    ragtek Guest

    If you have a very long text in a inputfield with the autoselect class, chrome won't select the text and firefox will crash:D
    In the js console you'll see

    my inputfield value was

    It's probably this jquery bug: http://bugs.jquery.com/ticket/10476

    My fix was to change the focus event with click

    XenForo.AutoSelect = function($input)
    $input.bind('focus', function(e)
    console.log('input select');
    return false;

    Attached Files:

  2. simbolo

    simbolo Well-Known Member

    The downside to that is if the user tabs in to the input then it won't run the function because it's no longer using the focus event. Upgrading xF jQuery to 1.7.2 would be nice.
    Adam Howard and (deleted member) like this.
  3. ragtek

    ragtek Guest

    I agree, but where do you use the AutoSelect? IMO not in forms (where you use tabs).. Instead it's "most" used in "input fields" where users can copy the text ..



    So it would be at least a quick fix, before they want to upgrade the jquery version^^
    simbolo likes this.
  4. simbolo

    simbolo Well-Known Member

    I actually use it within an add on within a form to auto select. That said, I would agree that it isn't heavily used in that application and the more likely use case is the one you point out in your second attachment.
  5. Mike

    Mike XenForo Developer Staff Member

    It doesn't look like a jQuery bug to me. We were calling focus() within a focus event, so it was triggering an infinite loop. Sorted now though.
    Slavik likes this.

Share This Page