-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Sticky): preserve item height (#3500)
* Preserve sticky item height fixes(3499) * Add above content example * Update StickyExampleAboveContent.js
- Loading branch information
1 parent
9aff7ea
commit 6eefe00
Showing
4 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
docs/src/examples/modules/Sticky/Usage/StickyExampleAboveContent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React, { Component, createRef } from 'react' | ||
import { Image, Input, Menu, Segment, Sticky } from 'semantic-ui-react' | ||
import _ from 'lodash' | ||
|
||
export default class StickyExampleAboveContent extends Component { | ||
contextRef = createRef() | ||
|
||
render() { | ||
return ( | ||
<div ref={this.contextRef}> | ||
<Sticky context={this.contextRef}> | ||
<Menu | ||
attached='top' | ||
tabular | ||
style={{ backgroundColor: '#fff', paddingTop: '1em' }} | ||
> | ||
<Menu.Item as='a' active name='bio' /> | ||
<Menu.Item as='a' active={false} name='photos' /> | ||
<Menu.Menu position='right'> | ||
<Menu.Item> | ||
<Input | ||
transparent | ||
icon={{ name: 'search', link: true }} | ||
placeholder='Search users...' | ||
/> | ||
</Menu.Item> | ||
</Menu.Menu> | ||
</Menu> | ||
</Sticky> | ||
<Segment attached='bottom'> | ||
{_.times(5, i => <Image key={i} src='/images/wireframe/paragraph.png' />)} | ||
</Segment> | ||
</div> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters