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

Async Popup doesn't update position and alignment #641

@joheredi

Description

@joheredi

Bug Report

When Popup content is loaded asynchronously and it needs to expand, Popup grows in a direction that no longer honors position and alignment

asyncpopup

Steps

import React from 'react'
import { Button, Popup, Segment } from '@stardust-ui/react'

const Component = () => <Segment styles={{minHeight: "300px"}}>Hello World</Segment>

const PopupExample = () => <Popup position="above" align="top" trigger={<Button icon="expand" />} content={{content: <AsyncData data={<Component />} />}} />

const render = data => {
  return !data ? "...loading" : data;
}

class AsyncData extends React.Component<{ render: Function; data?: any }> {
  state = { loading: true }

  componentDidMount() {
    setTimeout(() => { 
      console.log("TimedOut")
      this.setState({loading: false})
      
    }, 1000 )
  }

  public render() {
    const { loading } = this.state
    const { data } = this.props
    return loading ? "loading" : data
  }
} 

export default PopupExample

Expected Result

After content is loaded and Popup resized, it should maintain its position and alignment

Actual Result

Doesn't maintain position and alignment

Version

0.15.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    vstsPaired with ticket in vsts

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions