Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

fix(Popup): proper handling of clicks in nested Popups #949

Merged
merged 17 commits into from
Mar 25, 2019

Conversation

layershifter
Copy link
Member

@layershifter layershifter commented Feb 22, 2019

Fixes #1013.


Remove existing EventStack

Was completely replaced by @stardust-ui/react-component-event-listener & @stardust-ui/react-component-nesting-registry.

@levithomason
Copy link
Member

Per our chat, consider a bit of renaming for clarity and alignment with browser APIs:

    <EventHandler
      type='mousedown'
      listener={() => {}}
      targetRef={}
    />

@layershifter layershifter force-pushed the feat/children-nesting-api branch 2 times, most recently from d8c82e3 to bf15a47 Compare March 12, 2019 15:04
@layershifter layershifter force-pushed the feat/children-nesting-api branch 3 times, most recently from 392ebe7 to 25c5da6 Compare March 13, 2019 12:20
@codecov
Copy link

codecov bot commented Mar 13, 2019

Codecov Report

Merging #949 into master will decrease coverage by 0.2%.
The diff coverage is 95.08%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #949      +/-   ##
==========================================
- Coverage    82.3%   82.09%   -0.21%     
==========================================
  Files         715      711       -4     
  Lines        8656     8528     -128     
  Branches     1178     1224      +46     
==========================================
- Hits         7124     7001     -123     
+ Misses       1516     1511       -5     
  Partials       16       16
Impacted Files Coverage Δ
packages/react/src/lib/index.ts 100% <ø> (ø) ⬆️
.../src/lib/accessibility/FocusZone/FocusTrapZone.tsx 78.35% <100%> (-0.22%) ⬇️
packages/react/src/components/Portal/Portal.tsx 98.07% <100%> (-0.08%) ⬇️
packages/react/src/components/Menu/MenuItem.tsx 61.26% <50%> (-1.86%) ⬇️
packages/react/src/components/Popup/Popup.tsx 76.08% <95.74%> (-0.18%) ⬇️
packages/react/src/lib/whatInput.ts 63.38% <0%> (-1.41%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9b969d0...78f2c7e. Read the comment docs.

@layershifter layershifter force-pushed the feat/children-nesting-api branch 2 times, most recently from e463233 to 7cb4a24 Compare March 15, 2019 13:06
@DustyTheBot
Copy link
Collaborator

DustyTheBot commented Mar 15, 2019

Warnings
⚠️ Package (or peer) dependencies changed. Make sure you have approval before merging!

Changed dependencies in packages/react/package.json

package before after
@stardust-ui/react-component-event-listener - ^0.23.1
@stardust-ui/react-component-nesting-registry - ^0.23.1

Generated by 🚫 dangerJS

@layershifter layershifter changed the title WIP: new components for Event handling and controlling nesting fix(Popup): proper handling of nested Popups Mar 15, 2019
"files": [
"dist"
],
"homepage": "https://github.com/stardust-ui/react-component-nesting-registry#readme",
Copy link
Member

Choose a reason for hiding this comment

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

404

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

Updated to https://github.com/stardust-ui/react/tree/master/packages/react-component-nesting-registry, it is still 404, but will work after PR will be merged

@@ -470,7 +436,6 @@ export default class Popup extends AutoControlledComponent<ReactProps<PopupProps
const popupWrapperAttributes = {
...(rtl && { dir: 'rtl' }),
...accessibility.attributes.popup,
...accessibility.keyHandlers.popup,
Copy link
Member

Choose a reason for hiding this comment

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

I think accessibility.keyHandlers were originally planned to be generic enough to contain anything. With this being replaced by keyHandler on document is this still true?
popup-test contains neither isConformant nor handlesAccessibility :-/

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, I want to revert this change and rework behavior part separately. What do you think?

@layershifter layershifter added 🚀 ready for review 🧰 fix Introduces fix for broken behavior. labels Mar 19, 2019
…thub.com/stardust-ui/react into feat/children-nesting-api

# Conflicts:
#	CHANGELOG.md
#	packages/react-component-nesting-registry/src/NestingRoot.tsx
#	packages/react-component-nesting-registry/src/hooks/useNestingRoot.ts
@layershifter layershifter changed the title fix(Popup): proper handling of nested Popups fix(Popup): proper handling of clicks in nested Popups Mar 20, 2019
@layershifter
Copy link
Member Author

FYI: @miroslavstastny @mnajdova I moved keyboard/accessibility issues to a separate issue #1079

const popupContent = Popup.Content.create(content, {
defaultProps: popupContentAttributes,
overrideProps: this.getContentProps,
})
Copy link
Member Author

Choose a reason for hiding this comment

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

We don't need this check more, it was introduced in #592. Now it will be done by factories.

…thub.com/stardust-ui/react into feat/children-nesting-api

# Conflicts:
#	CHANGELOG.md
#	packages/react/package.json
#	packages/react/src/lib/accessibility/FocusZone/FocusTrapZone.tsx
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🧰 fix Introduces fix for broken behavior. 🚀 ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants