Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "TeachingBubble: Fix content from wrapping to next line unncessarily",
"type": "patch"
}
],
"packageName": "office-ui-fabric-react",
"email": "edwl@microsoft.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
max-width: 364px;
border: 0;
box-shadow: none !important;
width: calc(100% + 1px);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm confused why this is needed. Why not white-space: nowrap;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

white-space: nowrap isn't desirable because we still want content to wrap.

screen shot 2018-06-06 at 6 49 19 pm


animation-name: (bounceAnimation, opacityFadeIn);
animation-duration: 2000ms;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class TeachingBubble extends BaseComponent<ITeachingBubbleProps, ITeachin
}

public render(): JSX.Element {
const { calloutProps: setCalloutProps, targetElement, onDismiss } = this.props;
const { calloutProps: setCalloutProps, targetElement, onDismiss, isWide } = this.props;
const calloutProps = { ...this._defaultCalloutProps, ...setCalloutProps };

return (
Expand All @@ -56,7 +56,7 @@ export class TeachingBubble extends BaseComponent<ITeachingBubbleProps, ITeachin
className={css(
'ms-TeachingBubble',
styles.root,
this.props.isWide ? styles.wideCallout : null,
isWide ? styles.wideCallout : null,
calloutProps ? calloutProps.className : undefined
)}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class TeachingBubbleContent extends BaseComponent<ITeachingBubbleProps, I

public render(): JSX.Element {
const {
children,
illustrationImage,
primaryButtonProps,
secondaryButtonProps,
Expand All @@ -34,7 +35,8 @@ export class TeachingBubbleContent extends BaseComponent<ITeachingBubbleProps, I
hasCloseIcon,
onDismiss,
closeButtonAriaLabel,
hasSmallHeadline
hasSmallHeadline,
isWide
} = this.props;

let imageContent;
Expand Down Expand Up @@ -68,10 +70,10 @@ export class TeachingBubbleContent extends BaseComponent<ITeachingBubbleProps, I
);
}

if (this.props.children) {
if (children) {
bodyContent = (
<div className={css('ms-TeachingBubble-body', styles.body)}>
<p className={css('ms-TeachingBubble-subText', styles.subText)}>{this.props.children}</p>
<p className={css('ms-TeachingBubble-subText', styles.subText)}>{children}</p>
</div>
);
}
Expand Down Expand Up @@ -112,14 +114,14 @@ export class TeachingBubbleContent extends BaseComponent<ITeachingBubbleProps, I
}

return (
<div className={css('ms-TeachingBubble-content', styles.root)}>
<div className={css('ms-TeachingBubble-content', styles.root, isWide ? styles.wideCallout : null)}>
{imageContent}
{closeButton}
<div className={css('ms-TeachingBubble-bodycontent', styles.bodyContent)}>
{headerContent}
{bodyContent}
{footerContent}
</div>
{closeButton}
</div>
);
}
Expand Down