Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Added message stream to popover #1978

Merged
merged 9 commits into from
Sep 18, 2018
Merged

Conversation

Blackbaud-TrevorBurch
Copy link
Member

Resolves #1839

@@ -384,10 +384,35 @@ <h3>
<button
type="button"
class="sky-btn sky-btn-default"
[skyPopover]="asyncPopoverRef">
[skyPopover]="asyncPopover">
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this still needs to reference the asyncPopoverRef variable from the component.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

type="button"
class="sky-btn sky-btn-default"
(click)="closePopover()">
Close popover
Copy link
Contributor

Choose a reason for hiding this comment

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

As you mentioned offline, the popover always closes when you click outside the popover. To better demonstrate the close, could you simple place this button inside the popover?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think we really want to do that as I don't know that popovers are normally intended for buttons. However, we could do something where it opens and then uses a timer to close after a certain amount of time.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok. This has been modified.

<button
type="button"
class="sky-btn sky-btn-default"
[skyPopover]="programaticPopoverRef"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does putting the programmatic popover on a button with the directive on it kind of defeat the purpose? This button will work regardless of the skyPopoverMessageStream input var. Is there a better way we could show a programatic example?

Copy link
Member Author

Choose a reason for hiding this comment

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

This has been modified.

@blackbaud-johnly
Copy link
Contributor

blackbaud-johnly commented Sep 12, 2018

Created #1986 to document new input

@Blackbaud-TrevorBurch
Copy link
Member Author

@blackbaud-conorwright @Blackbaud-AlexKingman I've pushed another small change to the demo. Let me know if you have anything else here.

@Blackbaud-AlexKingman Blackbaud-AlexKingman merged commit 618825b into master Sep 18, 2018
@Blackbaud-AlexKingman Blackbaud-AlexKingman deleted the popover-message-stream branch September 18, 2018 14:15
Copy link
Member

@Blackbaud-SteveBrush Blackbaud-SteveBrush left a comment

Choose a reason for hiding this comment

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

Needs to be addressed in a different pull request.

@@ -391,3 +391,28 @@ <h3>
<sky-popover #asyncPopover>
My asynchronous popover.
</sky-popover>

<h3>
Popovers may be interacted with programatically

Choose a reason for hiding this comment

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

"programmatically"


public openPopover() {
this.sendMessage(SkyPopoverMessageType.Open);
setTimeout(() => {

Choose a reason for hiding this comment

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

This is causing some strange behavior in the demo. I would isolate this to two separate buttons, "Open" and "Close".

<button
type="button"
class="sky-btn sky-btn-default"
[skyPopover]="programaticPopover"

Choose a reason for hiding this comment

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

"programmatic"

type="button"
class="sky-btn sky-btn-default"
(click)="openPopover()">
Open popover programatically

Choose a reason for hiding this comment

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

"programmatically"

</button>
</p>
<sky-popover #programaticPopover>
This popover has a programatic trigger on the second button.

Choose a reason for hiding this comment

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

"programmatic"

/* tslint:disable-next-line:switch-default */
switch (message.type) {
case SkyPopoverMessageType.Open:
this.positionPopover();

Choose a reason for hiding this comment

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

We need to make sure that the popover itself uses the message stream to open/close/position so that consumers can interrupt the message stream as they see fit.

For example, you would replace this.positionPopover(), here:

this.positionPopover();

...with this.sendMessage(SkyPopoverMessageType.Open);

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

Issue created: #1994

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.

4 participants