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

[dialogs] improve display of dialogs #6905

Closed
vince-fugnitto opened this issue Jan 17, 2020 · 7 comments
Closed

[dialogs] improve display of dialogs #6905

vince-fugnitto opened this issue Jan 17, 2020 · 7 comments
Labels
dialogs issues related to dialogs good first issue good first issues for new contributors help wanted issues meant to be picked up, require help ui/ux issues related to user interface / user experience

Comments

@vince-fugnitto
Copy link
Member

Description

Currently, dialogs which have a lot of content are not properly displayed (width-wise).

In order to fix their entire content, the dialog will take up as much width as possible which gives off a poor UX. Instead of placing the responsibility on developers to place carriage returns, the application should define proper max-width rules to enforce a consistent layout.

Developers are still free to extend existing dialogs in order to style them as they so choose.

For example:

image

@vince-fugnitto vince-fugnitto added help wanted issues meant to be picked up, require help good first issue good first issues for new contributors dialogs issues related to dialogs ui/ux issues related to user interface / user experience labels Jan 17, 2020
@vince-fugnitto
Copy link
Member Author

We can add a new optional parameter to DialogProps for which we control the desired width of the dialog. This will mean that existing dialogs will not be broken by the change, but we can adjust internal dialogs with the new parameter.

export class DialogProps {
readonly title: string;
}

@JesterOrNot
Copy link

JesterOrNot commented Jan 19, 2020

Can I work on this?
I would first like to create the optional variable and then figure out how to apply the new instance variable to the dialogs

@vince-fugnitto
Copy link
Member Author

Can I work on this?

Sure! 👍

@JesterOrNot
Copy link

I've created the instance variable how do I implement the maxWidth part?

@vince-fugnitto
Copy link
Member Author

I've created the instance variable how do I implement the maxWidth part?

I was thinking of adding a new optional property to the DialogProps, and based on the value we'd update the styling of the dialog (maxWidth, wordWrap). Perhaps some changes will be need to be made to the AbstractDialog in order to be able to customize the outer container.

Then we can do something like the following in the constructor of a dialog:

this.container.setAttribute(`style`, `max-width: ${max-width} px`);

Callers could do the following:

new ConfirmDialog({
  title: 'title'
  maxWidth: 150,
  msg: 'msg',
  ok: 'yes',
  cancel: 'No'
});

@kaiyue0329
Copy link
Contributor

@vince-fugnitto Would using flex-wrap: wrap; on the dialog be an alternative solution?

@vince-fugnitto
Copy link
Member Author

Closed by #7080

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dialogs issues related to dialogs good first issue good first issues for new contributors help wanted issues meant to be picked up, require help ui/ux issues related to user interface / user experience
Projects
None yet
Development

No branches or pull requests

3 participants