Skip to content

Coachmark: Positioning fixes#4995

Merged
leddie24 merged 51 commits intomicrosoft:masterfrom
leddie24:coachmarkFixes
Jun 1, 2018
Merged

Coachmark: Positioning fixes#4995
leddie24 merged 51 commits intomicrosoft:masterfrom
leddie24:coachmarkFixes

Conversation

@leddie24
Copy link
Copy Markdown
Collaborator

@leddie24 leddie24 commented May 25, 2018

Pull request checklist

Description of changes

  • Fixed positioning bugs (Coachmark/TeachingBubble will re-position on scroll/resize properly)
  • Added in missing positions for Coachmark as well as alignment edges for the TeachingBubble/Beak
  • Adds in missing beak directions for Beak
  • Removed configuration props for Coachmark and set them as CONSTs instead
  • Updated basic example to provide configuration of Coachmark position via Dropdown
  • Fix TeachingBubble styling for buttons

Coachmark right position:
screen shot 2018-05-25 at 11 26 21 am

Coachmark top position:
screen shot 2018-05-25 at 11 26 37 am

Coachmark left position
screen shot 2018-05-25 at 11 26 44 am

Teaching bubble close button hover fix

Before:
screen shot 2018-05-25 at 11 30 54 am

After
screen shot 2018-05-25 at 11 27 02 am

Focus areas to test

(optional)

edwlmsft added 30 commits April 23, 2018 21:21
…et element. Fix documentation page to not hide overflow on Coachmark example.
….ts. Add string to 'target' type, Add COACHMARK_ATTRIBUTE_NAME. Fix TeachingBubble closeButton selector.
…erProps. TODO fix Beak transform for different directions. Change Coachmark size and beak size.
…sions and set as exported const. Fix scss selectors for TeachingBubble buttons.
…n't contain element. TODO fix bounds for target rect
@leddie24 leddie24 requested review from cschlechty and joschect May 25, 2018 18:25
);
}

public dismiss = (ev?: Event | React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>): void => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since dismiss is public you'll need to keep it around and deprecate it.

} else {
// Beak is aligned to the top of target
if (targetAlignment === RectangleEdge.top) {
beakTop = `calc(${COACHMARK_WIDTH / 2}px - ${BEAK_WIDTH / 2}px)`;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are you using calc? That's likely going to be slower than just doing the calculation right here in javascript.

};
}

private get _beakDirection(): BeakDirection {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd recommend using rectangleEdge from positioning. Then implement a public "getOppositeEdge" function in positioning which would look like

export function getOppositeEdge(edge: RectangleEdge): RectangleEdge {
    return edge * -1;
} 


export interface IBeak { }

export enum BeakDirection {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reuse RectangleEdge from positioning

@micahgodbolt
Copy link
Copy Markdown
Member

@joschect i'm happy to sign off on this a codeowner as long as you are

@leddie24
Copy link
Copy Markdown
Collaborator Author

Looks like there's some bug only reproing in Windows. The Positioning container cuts off the teaching bubble and doesn't fully extend to its full height.

@micahgodbolt
Copy link
Copy Markdown
Member

give me a shout when you've got those bugs wrapped up and i'll approve

@leddie24
Copy link
Copy Markdown
Collaborator Author

leddie24 commented Jun 1, 2018

@micahgodbolt could you take another look when you get a chance? Thanks!

@micahgodbolt
Copy link
Copy Markdown
Member

As long as it all passes, i'm good. @joschect already signed off

@leddie24 leddie24 merged commit e87289b into microsoft:master Jun 1, 2018
@leddie24 leddie24 deleted the coachmarkFixes branch June 1, 2018 20:24
Markionium added a commit to Markionium/office-ui-fabric-react that referenced this pull request Jun 2, 2018
* master: (274 commits)
  Demo Page Refactor Part 1 (microsoft#5055)
  SplitButton: Add aria-roledescription (microsoft#5062)
  Add addins sketch toolkit link (microsoft#5052)
  Dropdown title (microsoft#4983)
  Allow for more control over event handling for keytips (microsoft#5064)
  Build time speed improvements (microsoft#4965)
  Coachmark: Positioning fixes (microsoft#4995)
  Applying package updates.
  Experiments/Nav component: display "show more" link only if there is atleast one hidden link (microsoft#5057)
  Add pointerup listener to exit keytip mode (microsoft#5051)
  Update PULL_REQUEST_TEMPLATE.md
  Update ISSUE_TEMPLATE.md
  Shimmer: resolve conflicts (microsoft#5034)
  Invalid ARIA attributes: Fix empty values (microsoft#5040)
  ComboBox: Correct invalid ARIA attributes. (microsoft#4873) (microsoft#5001)
  ComboBox: Fix submit pending value (microsoft#5048)
  FocusTrapZone - restore last focused descendant element (microsoft#4897)
  Applying package updates.
  Take 2 of the require.resolve change. This time using the "resolve" pkg (microsoft#5031)
  fixing webpack config to allow rush build to complete on a small VM (microsoft#5037)
  ...
Markionium added a commit to Markionium/office-ui-fabric-react that referenced this pull request Jun 3, 2018
* master: (111 commits)
  Moving a variable to be defined sooner so that it is there when failures occur.
  Fix icon imports (microsoft#5069)
  MessageBar: More visible HC color for dismiss and expand buttons (microsoft#5061)
  Fix DetailsList accessibility and add more ARIA hooks (microsoft#5066)
  Update jest (microsoft#5068)
  Demo Page Refactor Part 1 (microsoft#5055)
  SplitButton: Add aria-roledescription (microsoft#5062)
  Add addins sketch toolkit link (microsoft#5052)
  Dropdown title (microsoft#4983)
  Allow for more control over event handling for keytips (microsoft#5064)
  Build time speed improvements (microsoft#4965)
  Coachmark: Positioning fixes (microsoft#4995)
  Applying package updates.
  Experiments/Nav component: display "show more" link only if there is atleast one hidden link (microsoft#5057)
  Add pointerup listener to exit keytip mode (microsoft#5051)
  Update PULL_REQUEST_TEMPLATE.md
  Update ISSUE_TEMPLATE.md
  Shimmer: resolve conflicts (microsoft#5034)
  Invalid ARIA attributes: Fix empty values (microsoft#5040)
  ComboBox: Correct invalid ARIA attributes. (microsoft#4873) (microsoft#5001)
  ...
dzearing pushed a commit that referenced this pull request Jul 24, 2018
…5656)

* Cherry pick Coachmark: Positioning fixes (#4995) e87289b

* Cherry pick TeachingBubble/Coachmark: Fix TeachingBubble content wrapping to next line unnecessarily (#5121) 72bab3c

* Cherrry pick Fix import paths to use relative paths in product code (#5338) e2076e1

* Cherry pick Coachmark accessibility #5155 7a36bb9

* Revert formatting back to 5.0 in Coachmark.tsx

* Fix unnecessary ; and change " to '

* Fix merge conflicts for Coachmark.Basic.Example.tsx

* " to '

* Fix imports for TeachingBubble.tsx

* Update TeachinBubbleContent, update TeachingBubble snapshot

* Update snapshot.  Fix TeachingBubble.types

* Fix import for RefObject

* Fix some inadvertent formatting from prettier.
@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Teaching Bubble close icon on hover

4 participants