Skip to content

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Oct 14, 2016

Since patternfly 3.8, the structure of the HTML generated by the selectpicker js component has changed, and removing the original select element no longer necessarily removes the selectpicker div that's actually visible.

(Previously, the select would just get a class to hide it, and the div would appear right after it (as a sibling), whereas now, the new div eats up the select and moves it inside itself.)

This PR makes pf-select explicitly destroy the selectpicker when the element with that pf-select is going away.


Code like:

<div ng-if="condition">
  <select pf-select>...</select>
</div>

always works, but when the if is on the select:

<select pf-select ng-if="condition">...</select>

then making the condition true and then false causes the selectpicker to stay on the page without this PR.

Since patternfly 3.8, the structure of the HTML generated by the selectpicker has changed, and removing the original select element no longer necessarily removes the selectpicker div that's actually visible.

This makes pf-select explicitly destroy the selectpicker when the element with that pf-select is going away.

(Related to ManageIQ/manageiq#11893)
@himdel
Copy link
Contributor Author

himdel commented Oct 14, 2016

Ping @jeff-phillips-18 ;)

Copy link
Member

@jeff-phillips-18 jeff-phillips-18 left a comment

Choose a reason for hiding this comment

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

👍

@dgutride
Copy link
Member

Looks good

@dgutride dgutride merged commit 9967db2 into patternfly:master Oct 14, 2016
@himdel himdel deleted the select-destroy branch October 14, 2016 14:35
@himdel
Copy link
Contributor Author

himdel commented Oct 14, 2016

Thanks everybody! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants