Skip to content

Addressing Issue #3776 - Sticky component loops forever if background-color is not set for page#3833

Merged
oengusmacinog-zz merged 4 commits into
microsoft:masterfrom
oengusmacinog-zz:stick-bgc-3776
Jan 31, 2018
Merged

Addressing Issue #3776 - Sticky component loops forever if background-color is not set for page#3833
oengusmacinog-zz merged 4 commits into
microsoft:masterfrom
oengusmacinog-zz:stick-bgc-3776

Conversation

@oengusmacinog-zz

Copy link
Copy Markdown
Collaborator

Pull request checklist

Description of changes

added return default when reaching the html tag in while loop inside _getBackground() inside Sticky component

Focus areas to test

N/A

Brian Garland added 2 commits January 29, 2018 15:40
window.getComputedStyle(curr).getPropertyValue('background-color') === 'transparent') {
if (curr.tagName === 'HTML') {
// Fallback color if no element has a declared background-color attribute
return 'rgba(244, 244, 244, 1)';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should just use return; instead of returning a hard-coded value.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It does need some fallback value since without one it defaults to transparent:

transparent-sticky

I'm updating to assign it outside the function. Let me know your thoughts on the updated solution.

this.content = document.createElement('div');
this.content.style.background = this._getBackground();
this.content.style.background = this._getBackground() || 'rgba(244, 244, 244, 1)';
ReactDOM.render(<div>{ this.props.children }</div>, this.content);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lets make this value a prop that the consumer can choose.

… Sticky to ScrollablePane's property table
@oengusmacinog-zz oengusmacinog-zz merged commit ddc5440 into microsoft:master Jan 31, 2018
@oengusmacinog-zz oengusmacinog-zz deleted the stick-bgc-3776 branch January 31, 2018 21:57
gokunymbus added a commit that referenced this pull request Feb 1, 2018
…ckground-color is not set for page (#3833)"

This reverts commit ddc5440.
gokunymbus added a commit that referenced this pull request Feb 1, 2018
* Revert "Updating config files in @uifabric/icons package (#3851)"

This reverts commit 952ad79.

* Revert "Addressing Issue #3776 - Sticky component loops forever if background-color is not set for page (#3833)"

This reverts commit ddc5440.

* Revert "Fix issue in modal Selection handling (#3836)"

This reverts commit c304b01.

* Revert "Adding new WOFF files to the @uifabric/icons/fonts folder (#3848)"

This reverts commit 66a91aa.

* Revert "Controlled TextFields (#3796)"

This reverts commit b17a45f.
@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sticky component loops forever if background-color is not set for page

2 participants