Skip to content
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

feat(textarea): add start and end slots #28441

Merged
merged 22 commits into from
Nov 27, 2023
Merged

Conversation

averyjohnston
Copy link
Contributor

@averyjohnston averyjohnston commented Oct 31, 2023

Issue number: Part of #26297


What is the current behavior?

With the modern form control syntax, it is not possible to add icon buttons or other decorators to the sides of ion-textarea, as you can with ion-item.

What is the new behavior?

start and end slots added. While making this change, I also tweaked the CSS selectors responsible for translating the label above the input with "stacked" and "floating" placements, merging this logic into a single class managed by the TSX. I needed to add a new class for whether slot content is present, so the selectors were getting unwieldy otherwise.

Docs PR TBA; I plan on knocking out all three components at once when the features are all complete, to make dev builds easier to manage.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@github-actions github-actions bot added the package: core @ionic/core package label Oct 31, 2023
@averyjohnston averyjohnston changed the title Fw 2853 textarea feat(textarea): add start and end slots Nov 9, 2023
* we wrap both the start and end slots in separate
* elements and apply our padding styles to that instead.
*/}
<div class="start-slot-wrapper">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If desired, I can hide these wrappers via CSS or avoid rendering them entirely if there isn't any slotted content provided. I figured it'd be better to keep things simple since keeping them doesn't hurt anything aside from having an extra node in the DOM, but I'm cool with making that change.

Comment on lines -333 to -337
display: flex;

position: relative;

flex-grow: 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These weren't doing anything and were likely a copy-paste goof while adding the modern syntax; .native-wrapper is set to display: grid a few lines below this.

@averyjohnston averyjohnston marked this pull request as ready for review November 14, 2023 19:59
@averyjohnston averyjohnston requested review from a team and brandyscarney and removed request for a team November 14, 2023 20:00
Copy link
Contributor

@thetaPC thetaPC left a comment

Choose a reason for hiding this comment

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

LGTM, with minor change request. Everything works as intended!

core/src/components/textarea/textarea.scss Outdated Show resolved Hide resolved
Co-authored-by: Maria Hutt <thetaPC@users.noreply.github.com>
Base automatically changed from FW-2853-base to FW-2853 November 27, 2023 15:44
@averyjohnston averyjohnston merged commit de36cc8 into FW-2853 Nov 27, 2023
43 checks passed
@averyjohnston averyjohnston deleted the FW-2853-textarea branch November 27, 2023 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants