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

fix: add change orientation event with modal render #1346

Merged
merged 4 commits into from
Feb 12, 2021

Conversation

whitestranger7
Copy link
Contributor

@whitestranger7 whitestranger7 commented Feb 7, 2021

Please read and mark the following check list before creating a pull request:

Short description of what this resolves:

The solutions is quite simple - I just render new modal with new id. I dont think there would be a possibility to apply new position to old one. If you think we can apply new position for the modal - let me know pls

Closes #1132

@@ -93,7 +94,15 @@ export class Modal extends React.PureComponent<ModalProps, State> {
this.modalId = ModalService.hide(this.modalId);
};

public forceRender = (): void => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
public forceRender = (): void => {
private forceRender = (): void => {

Should not be public, should it?
If not, it should be declared below lifecycle methods

Copy link
Collaborator

@artyorsh artyorsh left a comment

Choose a reason for hiding this comment

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

forceRender should not be public most likely. I would suggest making it private and declaring it below the lifecycle methods then. If we leave it public, it's better to call that forceUpdate or simply update.

@malashkevich
Copy link
Member

Will it work correctly if the modal will contain some state? For example, if the user will put there Input and then change the orientation.
Anyway I would say that we need recalculate the original modal rather than hide/show

@whitestranger7
Copy link
Contributor Author

Will it work correctly if the modal will contain some state? For example, if the user will put there Input and then change the orientation.
Anyway I would say that we need recalculate the original modal rather than hide/show

Sure thing, it works fine with any children component inside. I've updated the method and made it private. Take a look

@malashkevich malashkevich merged commit 15fb285 into akveo:master Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modal layout is incorrect after Orientation change
3 participants