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

Add scroll_index to Column #7206

Merged
merged 10 commits into from
Dec 17, 2024
Merged

Add scroll_index to Column #7206

merged 10 commits into from
Dec 17, 2024

Conversation

ahuang11
Copy link
Contributor

@ahuang11 ahuang11 commented Aug 29, 2024

Closes #6083

import panel as pn

pn.extension()

def scroll_to_top(event):
    column.scroll_index = 100


column = pn.Column(
    *list(range(1000)),
    height=300,
    sizing_mode="fixed",
    scroll=True,
)
btn = pn.widgets.Button(name="Scroll to top", width=200, button_type="primary", on_click=scroll_to_top)
pn.Row(column, btn).servable()

(poorly named btn; should be scroll to index 100)

Screen.Recording.2024-08-29.at.12.46.16.PM.mov

@ahuang11 ahuang11 requested a review from philippjfr August 29, 2024 19:46
@ahuang11 ahuang11 changed the title Add scroll index Add scroll_index to Column Aug 29, 2024
Copy link

codecov bot commented Aug 29, 2024

Codecov Report

Attention: Patch coverage is 69.23077% with 8 lines in your changes missing coverage. Please review.

Project coverage is 81.79%. Comparing base (dba5062) to head (aac352c).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
panel/tests/ui/layout/test_column.py 33.33% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7206      +/-   ##
==========================================
- Coverage   82.21%   81.79%   -0.42%     
==========================================
  Files         339      339              
  Lines       51343    51368      +25     
==========================================
- Hits        42212    42018     -194     
- Misses       9131     9350     +219     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@philippjfr philippjfr added this to the v1.6.0 milestone Sep 9, 2024
panel/layout/base.py Outdated Show resolved Hide resolved
@ahuang11 ahuang11 modified the milestones: v1.6.0, v1.5.5 Dec 16, 2024
@philippjfr
Copy link
Member

Since this isn't bi-directionally synced and a one time "event" this should be implemented using a server side event. Will do that now so we can merge.

@philippjfr philippjfr merged commit 3c20154 into main Dec 17, 2024
15 of 17 checks passed
@philippjfr philippjfr deleted the add_scroll_index branch December 17, 2024 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make Column scroll position usefull
2 participants