Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

fix(uiSelectChoices) broken id interpolation #1533

Merged
merged 1 commit into from
Mar 29, 2016

Conversation

user378230
Copy link
Contributor

The id attribute on ui-select-choices-row is no longer interpolated correctly when using ui select with angular v1.5+.

This change switches to using ng-attr-id to ensure the id value is correctly interpolated before being assigned to the element.

Fixes #1522

openDropdown(el);

var generatedId = el.scope().$select.generatedId;
expect($(el).find('[id$="row-' + generatedId + '-0"]').length).toEqual(1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can change this to $(el).find('#row-' + generatedId + '-0')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this capture all elements if they shared that id? (In case a bug was introduced)

I haven't jQuery'd in years, according to http://stackoverflow.com/a/6744674 it wouldn't? I'll have to check later.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see what you're doing here - I think it would be better to just use the whole id, for simplicity.

$(el).find('#ui-select-choices-row-' + generatedId + '-0')

@wesleycho
Copy link
Contributor

Other than the minor adjustment, LGTM.

@gorghoa
Copy link

gorghoa commented Mar 29, 2016

Hi guys, sorry for the noise, I should not create pull request this early in the morning…

The full id selector should be '#ui-select-choices-row-' + generatedId + '-0'

@gorghoa
Copy link

gorghoa commented Mar 29, 2016

Dumb convention question: Should’nt the build files be included in the PR ?

The id attribute on ui-select-choices-row is no longer interpolated
correctly when using ui select with angular v1.5+.

This change switches to using ng-attr-id to ensure the id value is
correctly interpolated before being assigned to the element.

Fixes angular-ui#1522
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants