-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[SpeedDial] Allow a tooltip placement prop #12244
[SpeedDial] Allow a tooltip placement prop #12244
Conversation
017fcc0
to
e45ece3
Compare
@seanchambo What technique are you using for your horizontal speed-dial? There's an open issue for it (#10895)... |
I am just applying a class to the root and actions on the speed dial with |
Would you like to submit a PR for that? |
Yeah I can add it to this PR if you want |
@mbrookes I've added the commit to allow the actions to be placed in any direction |
f4c06c0
to
1236ef1
Compare
@seanchambo Great! @oliviertassinari Any thoughts on the prop name for the direction the SpeedDial opens? |
@seanchambo For want of anything better, let's go with It would also be good to add a demo to the docs with perhaps a radio to select the direction. You would also need to change the FAB position according to the selected direction. |
@mbrookes |
@oliviertassinari I'm leaning towards |
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.
Review comments are based on the assumption we go with direction
, so hold off until we agree on that.
@@ -15,12 +15,26 @@ export const styles = { | |||
root: { | |||
zIndex: 1050, | |||
display: 'flex', | |||
flexDirection: 'column-reverse', // Place the Actions above the FAB. | |||
}, | |||
/* Styles when actions are placed to the top */ |
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 follow the conventions used for these docs comments in rest of the components:
/* Styles applied to the root and action container elements when direction="up"
*/
actionsTop: { | ||
flexDirection: 'column-reverse', | ||
}, | ||
/* Styles when actions are placed to the bottom */ |
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.
etc.
return ( | ||
<div className={classNames(classes.root, classNameProp)} {...other}> | ||
<div className={classNames(classes.root, classNameProp, actionsPlacementClass)} {...other}> |
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.
classNameProp
goes last.
@@ -191,6 +217,10 @@ class SpeedDial extends React.Component { | |||
} | |||
|
|||
SpeedDial.propTypes = { | |||
/** | |||
* The placement of floating actions buttons in relation to speed dial. |
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.
"The direction the actions open relative to the floating action button."
@@ -55,6 +55,7 @@ class SpeedDialAction extends React.Component { | |||
onClick, | |||
open, | |||
tooltipTitle, | |||
tooltipPosition, |
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.
tooltipPlacement
? (Might as well keep it consistent with the Tooltip prop name).
There is a problem that I think needs to be addressed before we continue down this path. The placement of the FAB will not honour the absolute positioning. For instance, if the absolute positioning was the bottom right hand corner and the direction was down. The FAB would be moved up the page and the last action in the actions list would be positioned in the bottom right hand corner. This is because of the structure of the SpeedDial component. This structure would need to be changed in order for the absolute positioning to be placed on the FAB. I'm not sure if this is the expected behavior but I wanted to point this out before we go ahead. |
@seanchambo Yes:
Unless I'm missing something, you wouldn't want to absolute position in the bottom right, and have the actions go down or right. BTW Lets go with "direction" as the prop name. |
By the way, there is a native property with this name. |
There's the HTML |
My bad then :)
…On Thu, Jul 26, 2018, 10:24 Matt Brookes ***@***.***> wrote:
there is a native property with this name
There's the HTML dir attribute, and CSS direction style, but I didn't
find a direction attribute when I checked. Am I missing something?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12244 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADBNwwwBt5IxWCLSUpy1lAZLlmRvMdmkks5uKXy8gaJpZM4VaRNn>
.
|
@mbrookes Okay great, you are right those scenarios aren't very likely but was making sure that all cases didn't need to be accounted for. |
1236ef1
to
d0e59e8
Compare
a5775fe
to
1ee2436
Compare
@mbrookes have updated the PR to take care of your comments let me know what you think |
# Conflicts: # packages/material-ui-lab/src/SpeedDial/SpeedDial.js # pages/lab/api/speed-dial.md
1ee2436
to
1a12449
Compare
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.
@seanchambo Sorry for the delay, I was working on something else. LGTM.
No worries, we happy to merge? |
@oliviertassinari any objection? |
@mbrookes No objection :) |
@seanchambo Thanks! |
During review mui#12244 the names for directions changed and CI did not run which introduced errors.
During review #12244 the names for directions changed and CI did not run which introduced errors.
Allows adding a placement prop for the tooltip of the speed dial action.
I'm making my speed dial go horizontal which makes the tooltip positioning wrong
Closes #10895