Skip to content

Conversation

@sebaferreras
Copy link
Collaborator

@sebaferreras sebaferreras commented Jun 3, 2020

Short description of what this resolves:

The first "change" event from the PickerColumnCmp is not being emitted. The selected value is being updated behind the scenes, but the change is not communicated to the parent component/page.

This is not a bug in the way Ionic uses the component because the picker component doesn't update the input field value as the user changes the picker column – the input field is updated once the user clicks the "Done" button (https://i.gyazo.com/bdea4dc2f68c2b510b2c6fd231fe5fd3.mp4).

But it is a bug if you try to use the columns directly in another page/component and not as part of the PickerComponent

Changes proposed in this pull request:

Emit the first change event

@sebaferreras sebaferreras requested a review from a user June 3, 2020 10:01
Comment on lines -407 to -411
if (this.lastIndex === undefined) {
// have not set a last index yet
this.lastIndex = this.col.selectedIndex;

} else if (this.lastIndex !== this.col.selectedIndex) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

lastIndex is only used in these three lines of code, and I couldn't find any reason why the first event shouldn't be emitted to the parent component.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

This looks like a harmless change!

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.

2 participants