showAutocompleteOnFocus doesn't work #123

Closed
jcfariadias opened this Issue Nov 26, 2012 · 4 comments

Comments

Projects
None yet
2 participants
@jcfariadias

I cant get showAutocompleteOnFocus to work with my implementation as it doesn't output the full list of categories that the user can add, when the input field is clicked

<script type="text/javascript">```

            $(document).ready(function() {                
                $('form-post').bind("keyup", function(e) {
                    var code = e.keyCode || e.which; 
                    if (code  == 13) {               
                        e.preventDefault();
                        return false;
                    }
                });
                $("#categories").tagit({


                    fieldName: "categories[]",
                    availableTags: <?php echo $categories; ?>,
                    showAutocompleteOnFocus:true,
                    allowSpaces:true,
                    afterTagAdded: function(event,ui){
                        event.preventDefault();
                        //alert(ui.tagLabel);
                        $.ajax({
                            type: "POST",
                            url: category/insertCategory',
                            data:{"cat-name":ui.tagLabel.toString()},
                            cache:false
                        });
                    }

                });
            });
    </script>

I'm using jQuery 1.8.3 with jQuery UI 1.9.1

$categories Output

["Categoria","Categoria 1","Categoria 2"]
@aehlke

This comment has been minimized.

Show comment
Hide comment
@aehlke

aehlke Nov 26, 2012

Owner

Is it possible you can put a demo online that shows the unexpected behavior? That'd help debug, thanks!

Owner

aehlke commented Nov 26, 2012

Is it possible you can put a demo online that shows the unexpected behavior? That'd help debug, thanks!

@jcfariadias

This comment has been minimized.

Show comment
Hide comment
@jcfariadias

jcfariadias Nov 27, 2012

Here's a fiddle on the page source

http://jsfiddle.net/5HPCN/

Thank you

Here's a fiddle on the page source

http://jsfiddle.net/5HPCN/

Thank you

@aehlke

This comment has been minimized.

Show comment
Hide comment
@aehlke

aehlke Nov 28, 2012

Owner

Sorry about that, fixed in 1b5378a !

Owner

aehlke commented Nov 28, 2012

Sorry about that, fixed in 1b5378a !

@aehlke aehlke closed this Nov 28, 2012

@jcfariadias

This comment has been minimized.

Show comment
Hide comment
@jcfariadias

jcfariadias Nov 28, 2012

Super! It's working now! Thank you for the awesome support!

Super! It's working now! Thank you for the awesome support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment