Skip to content

When focus is called on an input associated with an already open calendar, stuff breaks, but i have a fix #162

Description

@SamanthaClarke1

Alright, first of all, niche bug.
Second of all, sorry for not pushing through a proper pull request and all that, dont have all that much time.

Rome screws up on it's initialization when you pass through multiple fields (see line 332 (this.initializeRome) of the standalone js)
I triggered this by opening an input, and then navigating to a different window and back, the browser tries to autofocus the input, and it breaks. The specific thing breaking for me was a calendar class, but it seems to be option dependant? Not sure, shouldnt matter.

Fix for me was just this little snippet, to change line 332.

      let tTarget = this.$('.' + this.options.styles.container);
      if(typeof tTarget['length'] != 'undefined' && tTarget.length >= 1) { // if there's multiple returned, we only need the first.
        tTarget = tTarget[0];
      }
      this.initializeRome(tTarget, this.options.dateValidator);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions