Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add originalEvent to _clearMenus function #26343

Closed
wants to merge 8 commits into from

Conversation

jakubhonisek
Copy link
Contributor

@jakubhonisek jakubhonisek commented Apr 19, 2018

fixes #26336

Copy link
Member

@Johann-S Johann-S left a comment

Choose a reason for hiding this comment

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

Please fix this error: https://travis-ci.org/twbs/bootstrap/jobs/368542629#L1156

and you must add a unit test to cover this case

@jakubhonisek
Copy link
Contributor Author

@Johann-S error was fixed

@Johann-S
Copy link
Member

Please add a unit test

@@ -341,6 +341,10 @@ const Dropdown = (($) => {
relatedTarget: toggles[i]
}

if (event) {
relatedTarget.original = event.originalEvent
Copy link
Member

Choose a reason for hiding this comment

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

relatedTarget.originalEvent would be better

@XhmikosR XhmikosR changed the title add originalEvent to _clearMenus function (fixes #26336) add originalEvent to _clearMenus function Apr 19, 2018
@Johann-S
Copy link
Member

Why did you limit this event to click ?

@jakubhonisek
Copy link
Contributor Author

@Johann-S I wanted to avoid a collision with the name originalEvent. Also click is the only action that closes the dropdown (except ESC press).

@@ -341,6 +341,10 @@ const Dropdown = (($) => {
relatedTarget: toggles[i]
}

if (event && event.type === 'click') {
relatedTarget.mouseEvent = event
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer: clickEvent

@@ -498,6 +498,39 @@ $(function () {
$dropdown.trigger('click')
})

QUnit.test('should fire hide and hidden event with a mouseEvent', function (assert) {
Copy link
Member

Choose a reason for hiding this comment

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

I you want to add this property only for click event, you should add a test which verify this property isn't added on other type of events

assert.notOk(e.clickEvent)
})
.on('hidden.bs.dropdown', function (e) {
assert.onotO(e.clickEvent)
Copy link
Member

Choose a reason for hiding this comment

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

assert.onotO(e.clickEvent) I don't think onotO exist on assert 😆

Copy link
Member

@Johann-S Johann-S left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@mdo can I add new features in our next release ? (4.1.1) Or should I wait for 4.2 ?

@XhmikosR
Copy link
Member

@Johann-S: does this need to be documented in docs?

@Johann-S
Copy link
Member

yep that can be usefull, good catch @XhmikosR 👍

@XhmikosR
Copy link
Member

Closing for lack of replies.

@XhmikosR XhmikosR closed this Jun 23, 2018
@jakubhonisek
Copy link
Contributor Author

Hi @XhmikosR , why did you close this pull request? Is there any action that I have to do? Or somebody else?

@XhmikosR
Copy link
Member

#26343 (comment)

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

Successfully merging this pull request may close these issues.

3 participants