Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "FocusZone: Align props to HTMLElement to be consistent",
"type": "patch"
}
],
"packageName": "office-ui-fabric-react",
"email": "[email protected]"
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
EventGroup,
KeyCodes,
css,
divProperties,
htmlElementProperties,
elementContains,
getDocument,
getId,
Expand Down Expand Up @@ -123,7 +123,7 @@ export class FocusZone extends BaseComponent<IFocusZoneProps, {}> implements IFo

public render() {
const { rootProps, ariaDescribedBy, ariaLabelledBy, className } = this.props;
const divProps = getNativeProps(this.props, divProperties);
const divProps = getNativeProps(this.props, htmlElementProperties);

const Tag = this.props.elementType || 'div';

Expand All @@ -134,7 +134,10 @@ export class FocusZone extends BaseComponent<IFocusZoneProps, {}> implements IFo
...divProps
}
{
...rootProps
// root props has been deprecated and should get removed.
Copy link
Member

Choose a reason for hiding this comment

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

Add change file.

Is it possible to add a test to cover the issue you were seeing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should be something that is caught at build time and I'm not quite sure why it wasn't. AT least for me if you do npm start it will fail in focus zone without this change.

Copy link
Member

Choose a reason for hiding this comment

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

The following PR is related, they both solve the issue. I think this is the correct fix where as mine solves a more general issue.

#4330

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1 on the need for a test


In reply to: 176491968 [](ancestors = 176491968)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The break was a typescript break, this would not break functionality. And since webpack build caught the problem I would say there is a problem in the build since it let it through, while local npm start caught the type error. I'm not sure adding a test is correct here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@manishgarg1 this really doesn't need a test, can you approve?

// it needs to be marked as "any" since root props expects a div element, but really Tag can
// be any native element so typescript rightly flags this as a problem.
...rootProps as any
}
className={ css('ms-FocusZone', className) }
ref={ this._root }
Expand Down