-
Notifications
You must be signed in to change notification settings - Fork 7
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
Re-implement Modal
component using HTMLDialogElement (#461)
#544
base: master
Are you sure you want to change the base?
Conversation
Update CSS properties in README.md. Done ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job! 👏🏻 Even with the decision of not having the closed Modal in the DOM. 👍
I just think we cannot remove the click-on-backdrop-to-close functionality.
| `--rui-Modal--large__width` | Width of large modal | | ||
| `--rui-Modal--fullscreen__width` | Width of fullscreen modal | | ||
| `--rui-Modal--fullscreen__height` | Height of fullscreen modal | | ||
| `--rui-Modal__animation__duration` | Duration of animation used (when opening modal) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when opening modal
Currently, closing of Modal
is not animated because the component is simply removed from the DOM.
@mbohal Do we also want animated closing? That would mean delayed removal from the DOM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to add one thing. Closing animation is hard to impelement. We do not have close handler, we have closeButtonRef
. I tried to implement it somehow today but without success. So it is up to our decision whether we want to spend some time on it or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After a fruitless afternoon I concur with @bedrich-schindler that:
Closing animation is hard to implement.
However, this change is not BC in terms of usage, so I think we should merge it as is.
We can add hide animation int he future. This will very likely change the API though…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On video call agreed that for the time being we will only support opening animation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR updated: * Introduced
While I introduces |
Just for info, tests need to be updated in #545 as new test environment is necessary. |
…ng HTMLDialogElement (#461)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a note regarding forms inside dialog, otherwise OK for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the "Launch modal as form" example and found out there is no <form>
element in it. Is it purposely? Maybe we didn't want the <form>
there before switching to <dialog>
but it would add more semantic meaning (and maybe functionality) now.
There is the method="dialog"
form attribute (or formmethod="dialog"
for buttons) if we find it useful.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog#usage_notes
Can @adamkudrna or anybody else help me with this? I returned to this to complete the pull request but suddenly, I have all the texts inside of Modal in white even though there is no change in the code. |
Closes #461, closes #537.