-
Notifications
You must be signed in to change notification settings - Fork 390
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
fix: FluentSelect does not work inside FluentDataGrid #217
Comments
I believe this is an issue in the underlying web components. Have raised an issue there, |
did you have find any solution? |
I believe it is solved on the FAST side. Need to wait till it is incorporated in the Fluent dcript. @chrisdholt do you know the schedule for that? |
This was part of our current Alpha breaking changes - it will show up in the vNext of Fluent, which will be aligned to Fluent 2 specs. We've currently started work on this, but again, it's part of a larger breaking change. There's a whole history of "why" this previously wasn't working/supported/etc which can provide additional details. One thing you could do in the meantime if you absolutely know and control the stacking context of your application, would be to target the listbox part and use fixed positioning...that would likely allow it to break out. |
We can't fix it properly with the current Fluent UI Web Components implementation. As a workaround apply the suggested fixed positioning css |
@vnbaaij Could you open this issue again? I have tested with Fluent 2 - Microsoft.Fast.Components.FluentUI 2.14 with @fluentui/[email protected] and it still does not work. Outside FluentDataGrid it works fine. This is a really big drawback since you need to use other libraries for the select. Code:
|
Hi Oscar, As explained, this is an issue in the underlying web components, We can't really fix it on the Blazor side. |
Hello Vincent, I understand. As I understood it this would be fixed in the Fluent 2 specs and therefore it could be fixed here as well. I did check the issue you opened in the FAST monorepo microsoft/fast#6373 and I will continue to monitor there if anything happens. I will try fixed positioning in the meantime then. |
@vnbaaij Trying Code would be appreciated given that it is a shadow-root element so it requires an override for the constructed stylesheet. This PR closed your issue in the FAST repo. Anything there that can be used to fix this issue permanently? If a fix is not possible I think this issue should be reopened since any hack will probably lead to similar braking changes in the future. |
@vnbaaij Source enum with None filtered:
I think this issue should be reopened and if this is related to the FAST side I think a new issue should be opened there given that they closed your original issue microsoft/fast#6373 as completed. |
Hi Oscar, I think we got the signals mixed up a bit when discussing this... |
I understand! :) Should the issue be reopened anyway since it is a bug but it can't be fixed now? |
@vnbaaij how can I override position style value to temporarily resolve this issue. I cannot find any document about override css |
Hi, You need to add an isolated css file to your component and then target the listbox part of the select. Something like
|
I'm didn't familiar with ::deep and ::part. so I learned it from you. thank a lot |
I'm using the FluentSelect in a DataGrid cell too. I only see one select option out of many (long list). When I click the down arrow for the Select I get no additional rows to appear. Based on this thread,.. do I set the Class property or the Style property. For the ::deep syntax above, do I say Class="listbox" or Style="listbox"? Is 'classname' = 'fluent-select'? and is that a typo for deep, one colon or two? is 'listbox' the ID of the FluentSelect? |
<TemplateColumn Title="Column with overflow content" Class="overflow-column">
<FluentSelect ... />
</TemplateColumn> ::deep fluent-data-grid-cell.overflow-column {
overflow: visible;
max-width: 0;
} As a side effect, when there is not enouph space, a horizontal scrollbar will be shown. But that is fine for my use case. |
Maybe some hint or information to this workaround should be added to the documentation of the FluentDataGrid? |
I don't want to do that because it kind of sends a signal that the grid can be used as a way to directly edit rows of data. It was not built with that in mind, so we do not want to 'promote' that way of working. |
@vnbaaij Have you tried it with a virtualized data grid? |
Sorry, tried what? The workaround with the overflow? As I explained, I think having an editable grid is not a good idea in general. But doing it on a virtualized grid with (potentially) a huge amount of rows is definitely a very bad idea. (huge load on the DOM) |
Yes exactly. It might technically be a bad idea but inline editing is something that users really like. Like the example with template columns. |
THis example does not work anymore |
We have changed the rendering of a DataGrid to use plain HTML tables. Using the code from #217 (comment) and the CSS from #217 (comment) (without the max-width) gives me: |
I used this css as mentioned in comments, like this:
and it doesn't show me the full list, it only shows 1 item, which fits the height of row... |
Style seems to have incorrect identifier or what it's called, fluent-data-grid-cell. I didn't get it to work how hard I tried to figure it out. Just add style="overflow: visible;" to the TemplateColumn |
@StefanJansson thank you for answering, I noticed that when I do this it works as you said
but when I add text-align it ruins it.
Do you know why and how can I fix it? |
Don't know why but if you put the align left inside a span, it works. To be honest, my knowledge of css is on a good day, crap 😂 |
🐛 Bug Report
When using FluentSelect inside FluentDataGrid dropdown is not shown.
💻 Repro or Code Sample
Based on these examples:
https://brave-cliff-0c0c93310.azurestaticapps.net/SelectPage
https://brave-cliff-0c0c93310.azurestaticapps.net/DatagridPage
I would also like some better examples working with enum values and select. I had to write my own code but I think this should be documented better. Added
MatSelectItem
as example since it works withFluentDataGrid
. Select works fine with Enum when not used inFluentDataGrid
Classes:
🤔 Expected Behavior
Should render drop down on click
😯 Current Behavior
No drop down is visible
💁 Possible Solution
🔦 Context
I can not use Fluent UI alone
🌍 Your Environment
The text was updated successfully, but these errors were encountered: