Skip to content

issue with menu position #6

@kanle485

Description

@kanle485

When i try to use this plugin in a modal, the menu is not showing in the correct position. I think this is caused by

show: function () {

  var pos = this.$element.position();
  var height = this.$element[0].offsetHeight;

  this.$menu
    .appendTo('body') 
    .show()
    .css({
      position: "absolute",
      top: pos.top + height + "px",
      left: pos.left + "px"
    });

  this.shown = true
  return this

}

in the show function it appends the menu to body (??)
it is originally

.insertAfter(this.$element)

in typeahead plugin. In my tests changing that line fixes the incorrect positioning problem of the menu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions