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

FilePicker - Tile view issue on first render #1558

Closed
DMichev opened this issue Jun 16, 2023 · 6 comments
Closed

FilePicker - Tile view issue on first render #1558

DMichev opened this issue Jun 16, 2023 · 6 comments
Labels
status:fixed-next-drop Issue will be fixed in upcoming release. type:bug
Milestone

Comments

@DMichev
Copy link
Contributor

DMichev commented Jun 16, 2023

Category

[ ] Enhancement

[ X] Bug

[ ] Question

Version

Please specify what version of the library you are using: [ 1.15.0 ]

Expected / Desired Behavior / Question

"Tiles" view should use all available space for rendering the items on first render

Observed Behavior

On initial rendering "Tiles" view option shows its items in a single column with fixed width of 232px.

FilePicker-initial-tile-view-rendering

After selecting an item or perform window resizing - it renders properly.
FilePicker-tile-view-after-item-selection

I think the problem comes from these default values (lines 100-102):
https://github.com/pnp/sp-dev-fx-controls-react/blob/dev/src/controls/filePicker/controls/TilesList/TilesList.tsx#L98

Without setting the container width on this line, it works correctly - https://github.com/pnp/sp-dev-fx-controls-react/blob/dev/src/controls/filePicker/controls/TilesList/TilesList.tsx#L150

Steps to Reproduce

Open FilePicker and navigate to a folder. Make sure "View option" is set to "Tiles". It will render the elements in a single fixed-width column.

@ghost
Copy link

ghost commented Jun 16, 2023

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@ghost ghost added the Needs: Triage 🔍 label Jun 16, 2023
@github-actions
Copy link

Thank you for submitting your first issue to this project.

@joelfmrodrigues
Copy link
Collaborator

Hey @DMichev many thanks for reporting this issue. Quickly checked the lines you mentioned and it does seem that the page width is being set to the same value as the column width, so it will fit only one item per line.
I assume the fix would be to handle the default value in a different way. Maybe _columnCount * _columnWidth or something similar?

Would you be interested in trying to fix this and submit a pull request?

@DMichev
Copy link
Contributor Author

DMichev commented Jun 16, 2023

Hi @joelfmrodrigues. Manual calculation can't help here. I found another way - re-render the component makes FluentUI List component know its surface width. It is in #1559

@joelfmrodrigues joelfmrodrigues added status:fixed-next-drop Issue will be fixed in upcoming release. and removed help wanted labels Jun 23, 2023
@joelfmrodrigues joelfmrodrigues added this to the 3.15.0 milestone Jun 23, 2023
@joelfmrodrigues
Copy link
Collaborator

PR merged, will be in the next beta release (in a few minutes) and also part of the next major release. Thanks!

@joelfmrodrigues
Copy link
Collaborator

New release just published, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:fixed-next-drop Issue will be fixed in upcoming release. type:bug
Projects
None yet
Development

No branches or pull requests

2 participants