-
Notifications
You must be signed in to change notification settings - Fork 273
feat(ui5-dialog): introduce resizable property #2301
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
Conversation
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 added a couple of comments. Overall looks good to me. One more thing should be added anyway. It is the min-height
for the content of the dialog. As much as I can see from the spec it should be as follows:
min-height: 2.75rem
for Cozymin-height: 2.5rem
for Compact
packages/main/src/Dialog.js
Outdated
onBeforeRendering() { | ||
this.onPhone = isPhone(); | ||
this.onDesktop = isDesktop(); | ||
} | ||
|
||
onEnterDOM() { | ||
this._isRTL = this.effectiveDir === "rtl"; |
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 am not sure that this is the best place to set the RTL, because the direction can be changed multiple times after the component has entered the DOM. A better solution might be to put it in the onBeforeRendering
method for example.
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.
Moved it to occur in onBeforeRendering. In the future, it might be better to do this check centrally (once) before all the ui5-webcomponents are rendered. I see a few web components are already doing this very same check, so it's fair to attempt to remove the duplication.
|
||
this._initialX = event.clientX; | ||
this._initialY = event.clientY; | ||
this._initialWidth = Number.parseFloat(width); |
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.
Please use the global function parseFloat
as it is natively supported by IE. This way babel would not have to transform it when it comes to the es5 build
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 added a seperate pull request to add support for Number.parseFloat #2302
@@ -80,6 +80,36 @@ describe("Dialog general interaction", () => { | |||
|
|||
browser.keys("esc"); | |||
}); | |||
|
|||
it.only("resizable", () => { |
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.
it("resizable", () => {
Currently this is the only test that is being run from the whole page. After removing the keyword only
, all the tests would be run. As much as I can see, the resizable dialog is initially opened. This might be a problem for the other tests. The best solution would be if all the dialogs are initially closed and in the test you open the needed dialog.
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.
Sorry, I forgot to remove this it.only
. I also removed the setTimeout on Dialog.html to restore the other tests as well.
outdated - comments have been resolved
Part of #2082