Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded alert: state change causes the infinite recursion #378

Closed
superwhykz opened this issue Jul 19, 2018 · 4 comments
Closed

Embedded alert: state change causes the infinite recursion #378

superwhykz opened this issue Jul 19, 2018 · 4 comments
Labels
Bug Something is broken and not working as intended in the system.

Comments

@superwhykz
Copy link

Issue summary

I am not sure what is happening but it seems on the state change causes the infinite recursion.

Expected behavior

The embedded alert should pop up.

Actual behavior

modal_issue

Steps to reproduce the problem

From Page component

handleCreateChange() {
    switch (this.props.tab) {
      case 0:
        if (this.props.list.length === 1) {
          this.props.setDisableCreate(true);
  ...
  ...
  ...
}

...
...
...

     },
        ]}
        primaryAction={{
          content: 'Create Rule',
          onAction: () => this.handleCreateChange(),
        }}
      >
        <Alert
          title="Reached limit"
          open={
            this.props.disableCreate &&
            !this.props.isFetching
          }
          confirmContent="Close"
          onConfirm={() => this.handleCreateChange()}
        >
          <TextContainer>
            <p>
              You can only modify existing set of rules!
            </p>
          </TextContainer>
        </Alert>

Specifications

  • Are you using the React components? (Y/N): Yes
  • Polaris version number: 2.4.0
  • Browser: Chrome Version 67.0.3396.99 (Official Build) (64-bit)
  • Device: MacPro
  • Operating System: MacOS Sierra 10.12.6
@dleroux dleroux added the Bug Something is broken and not working as intended in the system. label Jul 19, 2018
@dleroux
Copy link
Contributor

dleroux commented Jul 19, 2018

@superwhykz Thanks for letting us know! I'll open an issue internally and keep you posted.

@superwhykz
Copy link
Author

@dleroux thanks so much!

@dleroux
Copy link
Contributor

dleroux commented Jul 19, 2018

@superwhykz turns out that for security reasons we can only accept strings in the Alert. Remove the TextContainer and the <p> and it will be fine. Changing our internal issue to make that more clear in the future. Thanks for reporting this. I'll close this now.

@dleroux dleroux closed this as completed Jul 19, 2018
@superwhykz
Copy link
Author

Ehh ..... thanks so much for quick turn around!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken and not working as intended in the system.
Projects
None yet
Development

No branches or pull requests

2 participants