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: add scrollToStart and scrollToEnd API for text-area #7144

Merged
merged 8 commits into from
Feb 28, 2024

Conversation

AbdullahGheith
Copy link
Contributor

@AbdullahGheith AbdullahGheith commented Feb 23, 2024

Description

The PR introduces scrollToStart and scrollToEnd methods for the text-area component.

Followed by:

Fixes vaadin/flow-components#6042

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/contributing/overview
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.
  • I have not completed some of the steps above and my pull request can be closed immediately.

Additional for Feature type of change

  • Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.

@vursen vursen changed the title Feat/text area scrollability feat: add scrollToTop and scrollToBottom APIs to text-area Feb 27, 2024
@vursen vursen changed the title feat: add scrollToTop and scrollToBottom APIs to text-area feat: add API for scrolling text-area to the start and end Feb 27, 2024
@vursen vursen changed the title feat: add API for scrolling text-area to the start and end feat: add scrollToStart and scrollToEnd API for text-area Feb 27, 2024
@vursen
Copy link
Contributor

vursen commented Feb 27, 2024

FYI: Snippet to test the feature:

<script type="module">
  import '@vaadin/text-area';

  const textarea = document.querySelector('vaadin-text-area');

  const scrollToTop = document.querySelector('.scrollToTop');
  scrollToTop.addEventListener('click', () => {
    textarea.scrollToStart();
  });

  const scrollToBottom = document.querySelector('.scrollToBottom');
  scrollToBottom.addEventListener('click', () => {
    textarea.scrollToEnd();
  });
</script>

<button class="scrollToTop">Scroll to top</button>
<button class="scrollToBottom">Scroll to bottom</button>

<vaadin-text-area label="Feedback" style="max-height: 150px"></vaadin-text-area>

Copy link

sonarcloud bot commented Feb 27, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@vursen vursen merged commit 4f6f47e into vaadin:main Feb 28, 2024
7 of 9 checks passed
@AbdullahGheith AbdullahGheith deleted the feat/text-area-scrollability branch February 28, 2024 07:11
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.4.0.alpha9 and is also targeting the upcoming stable 24.4.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce scrollToStart / scrollToEnd to TextArea
3 participants