Skip to content

Better handling of 0 width Chosen #2001

Closed
@utkant

Description

@utkant

I am not sure why this is but I guess it is because it cannot be calculated its width. I therefore suggest it to be set to 100%(or not set at all) instead, so that it shows up when shown. If the function container_width could be changed to this:

AbstractChosen.prototype.container_width = function() {
  if (this.options.width != null) {
    return this.options.width;
  } else {
      if (this.form_field.offsetWidth == 0) {
          return '100%';
      } else {
          return "" + this.form_field.offsetWidth + "px";
      }
  }
};

I think that would make alot of people happy. I made that change and it helped me...

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