-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(content): add fixedSlotPlacement prop (#29233)
Issue number: Internal --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> Content in the `fixed` slot is always placed after the main content in the DOM. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - A new `fixedSlotPlacement` prop on Content allows developers to place fixed content either before or after the main content in the DOM ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer for more information. --> ## Other information Dev build: `8.0.0-dev.11712072527.1dd97c66` <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. -->⚠️ This feature will not be part of the v8.0 release. As a result, do not merge this into `feature-8.0`. However, I am putting this PR up based off `feature-8.0` so it can get reviewed by the team. --------- Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
- Loading branch information
1 parent
59b72f4
commit 8905696
Showing
7 changed files
with
59 additions
and
6 deletions.
There are no files selected for viewing
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
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,31 @@ | ||
import { newSpecPage } from '@stencil/core/testing'; | ||
|
||
import { Content } from '../content'; | ||
|
||
describe('content: fixed slot placement', () => { | ||
it('should should fixed slot after content', async () => { | ||
const page = await newSpecPage({ | ||
components: [Content], | ||
html: '<ion-content></ion-content>', | ||
}); | ||
|
||
const content = page.body.querySelector('ion-content')!; | ||
const fixedSlot = content.shadowRoot!.querySelector('slot[name="fixed"]')!; | ||
const scrollEl = content.shadowRoot!.querySelector('[part="scroll"]')!; | ||
|
||
expect(fixedSlot.nextElementSibling).not.toBe(scrollEl); | ||
}); | ||
|
||
it('should should fixed slot before content', async () => { | ||
const page = await newSpecPage({ | ||
components: [Content], | ||
html: `<ion-content fixed-slot-placement="before"></ion-content>`, | ||
}); | ||
|
||
const content = page.body.querySelector('ion-content')!; | ||
const fixedSlot = content.shadowRoot!.querySelector('slot[name="fixed"]')!; | ||
const scrollEl = content.shadowRoot!.querySelector('[part="scroll"]')!; | ||
|
||
expect(fixedSlot.nextElementSibling).toBe(scrollEl); | ||
}); | ||
}); |
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