I want to dynamically change the TileLayout Reorderable parameter but the component does not react to that change. Dynamic change in the Resizable parameter is also not applied.
I am also trying to change the TileLayoutItem ColSpan dynamically - for example, when implementing it in a responsive layout (https://docs.telerik.com/blazor-ui/knowledge-base/tilelayout-responsive) but using a variable as the ColSpan value does nothing. The TileLayout does not react to a change in the ColSpan parameter either.
It would be nice if the TelerikTileLayout could be told to refresh itself or to refresh after some of its parameters is changed.
When in a div with display:flex, I cannot resize the tiles to the right as I expect to - they stop resizing before I reach the end of the tile layout.
---
ADMIN EDIT
Here is a sample you can use to observe the issue - try resizing the tiles and change the size of the layout offset. For cleanest results do this in a blank app that has absolutely no other styles (so no other layout is in play).
A short gif is attached at the end of this post that shows the problem.
<TelerikNumericTextBox @bind-Value="@width" Step="20" Min="0" Max="800"></TelerikNumericTextBox>
@code{
int width { get; set; } = 200;
}
<div style="display:flex; flex-direction: row;">
<div style="width: @(width)px; background: yellow;">
some content on the left. When this is here, resizing tiles cannot use the full width of the tile layout
- it stops short with the offset by this element due to the flex layout.
Change the width of this element to see the effect - as you increase you will stop being
able to resize 1column tiles at all. If you decrease, eventually you will be.
</div>
<div style="position: relative; display: block;"> @* THE WORKAROUND - REMOVE TO SEE THE PROBLEM *@
<TelerikTileLayout ColumnWidth="200px"
RowHeight="150px"
Width="700px"
Columns="3"
Resizable="true">
<TileLayoutItems>
<TileLayoutItem HeaderText="Panel 1">
<Content>Regular sized first panel.</Content>
</TileLayoutItem>
<TileLayoutItem HeaderText="Panel 2">
<Content>You can put components in the tiles too.</Content>
</TileLayoutItem>
<TileLayoutItem HeaderText="Panel 3" RowSpan="3">
<Content>This tile is three rows tall.</Content>
</TileLayoutItem>
<TileLayoutItem HeaderText="Panel 4" RowSpan="2" ColSpan="2">
<Content>This tile is two rows tall and two columns wide</Content>
</TileLayoutItem>
</TileLayoutItems>
</TelerikTileLayout>
</div>
</div>
---
Currently, only `RowSpan` `ColSpan` and `HeaderText` parameters cause a `TileLayout` to rerender when changed. I use `Class` changes for a lot of styling (in particular it's useful for hiding/showing a `TileLayoutItem` without losing its position in the layout) and have to manually detect and call `StateHasChanged()` when the `Class` parameter changes on `TileLayoutItem`.
Please allow dynamic change of the TileLayoutItem Class property.
The TileLayout should not render tabindex="0" on its tiles when Navigable="false".
Here is a test page with a workaround:
@inject IJSRuntime js
<p>Tab through the textboxes:</p>
<input />
<TelerikTileLayout Columns="2"
RowHeight="200px"
Resizable="false"
Reorderable="false"
Navigable="false"
Class="tilelayout-tabindex-remove">
<TileLayoutItems>
<TileLayoutItem HeaderText="Tile 1">
<Content>
<p>TileLayout Navigable="false" - will focus the inner textbox and will not focus the tiles.</p>
<input />
</Content>
</TileLayoutItem>
<TileLayoutItem HeaderText="Tile 2">
<Content>Tile 2 content.</Content>
</TileLayoutItem>
</TileLayoutItems>
</TelerikTileLayout>
<input />
<TelerikTileLayout Columns="2"
RowHeight="200px"
Resizable="false"
Reorderable="false"
Navigable="true">
<TileLayoutItems>
<TileLayoutItem HeaderText="Tile 1">
<Content>
<p>TileLayout Navigable="true" - will not focus the inner textbox and will focus the tiles. Focus the textbox with Enter when on the tile.</p>
<input />
</Content>
</TileLayoutItem>
<TileLayoutItem HeaderText="Tile 2">
<Content>Tile 2 content.</Content>
</TileLayoutItem>
</TileLayoutItems>
</TelerikTileLayout>
<input />
<script suppress-error="BL9992">
function removeTabindexFromTiles(selector) {
var tileLayout = document.querySelector(selector);
if (!tileLayout) {
return;
}
tileLayout.querySelectorAll(".k-tilelayout-item").forEach(el => {
el.removeAttribute("tabIndex");
});
}
</script>
@code {
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await Task.Delay(1); // ensure HTML is ready
await js.InvokeVoidAsync("removeTabindexFromTiles", ".tilelayout-tabindex-remove");
}
await base.OnAfterRenderAsync(firstRender);
}
}
We have a tile layout control within a tab page used on the whole page, we have resizing and moving enabled by dragging. Works well on desktop however on ios safari users are unable to scroll on the page, instead the page either does not move or tiles resize/move. If we disable only resizable or reorderable, the page is still not scrollable.
===
ADMIN EDIT
===
The only option for the time being is to disable resizing and reordering on mobile devices.