Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

got error when resize window #40

Closed
daruma8 opened this issue Dec 11, 2013 · 6 comments
Closed

got error when resize window #40

daruma8 opened this issue Dec 11, 2013 · 6 comments

Comments

@daruma8
Copy link

daruma8 commented Dec 11, 2013

I am not sure it's a bug or my my failt,
when resizing window, error waw shown like below
"Uncaught TypeError: Cannot call method 'outerWidth' of undefined "

if I focus the input at first, resizing the window will not show this error.

So, at line 276 of source file, I added below

if(maxLengthIndicator === undefined) return;

the error disappeared.

@mimo84
Copy link
Owner

mimo84 commented Dec 11, 2013

Can I please have a bit more details? I tested it on Chrome Firefox and IE11, but I don't get any error.

@daruma8
Copy link
Author

daruma8 commented Dec 11, 2013

Maybe I did something wrong,I will check it again, thank you!

I am using Cackephp 2.4.3
I tested it on Chrome ,IE8, and same error was shown,

here is my source :

/layout/
$(function(){
$('input[maxlength]').maxlength({
alwaysShow: true,
warningClass: "label label-info",
limitReachedClass: "label label-warning",
placement: 'bottom',
});
});

/* ctp */

Form->create('aModel', array( 'inputDefaults' => array( 'div'=>'col-xs-12', 'wrapInput' => false, 'label' => false, 'class' => 'form-control', ), )); ?>
        <?php 
            echo $this->Form->input('name');
        ?>
Form->end('submit'); ?>

@mimo84
Copy link
Owner

mimo84 commented Dec 11, 2013

I don't see the maxlength attribute set up. Am I missing something maybe? Can you create a short snippet on Plunker? I am not sure what is the output of CachePHP for the input.

@daruma8
Copy link
Author

daruma8 commented Dec 11, 2013

I am using CakePHP, not CackePHP,sorry for my pool english ...
here is the link
http://plnkr.co/edit/dUr63IwrjEJXPL0EgGnj

@mimo84
Copy link
Owner

mimo84 commented Dec 11, 2013

Ok, so in your code there were two errors (in the plunk): a trailing comma on the options object and you were including the file from GitHub. Here is the corrected version:
http://plnkr.co/edit/Nk2LSP4X25f4LA1GTLIf?p=preview
Feel free to reopen the ticket if there is anything you think is caused by the plugin.

@mimo84 mimo84 closed this as completed Dec 11, 2013
@ryanbriscall
Copy link

I get this error by opening Chrome Dev Tools. I tested it on the plunker snippet(above), and it occurs there as well. http://cl.ly/image/1o1S1S1o001L It's not a big deal, but still would prefer to have my console clean of errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants