Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

docs(Window): remove centered parameter #2826

Merged
merged 3 commits into from
Mar 27, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/window/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ You can make the Window component responsive and allow it to adapt to different

## Position

You can set the position of the Window with the `Top` and `Left` parameters. The component features a boolean `Centered` parameter, which is `true` by default when `Top` and `Left` are not set. The Window component also provides a `ContainmentSelector` parameter that can limit resizing and dragging within the boundaries of a specified container.
You can set the position of the Window with the `Top` and `Left` parameters. The Window component also provides a `ContainmentSelector` parameter that can limit resizing and dragging within the boundaries of a specified container.

Read more about the [Blazor Window position...](slug:components/window/position)

Expand Down Expand Up @@ -84,7 +84,6 @@ The following table lists the Window parameters. Also check the [Window API](slu

| Parameter | Type and Default Value | Description |
| --- | --- | --- |
| `Centered` | `bool` <br /> (`true`) | Determines if the Window displays in the middle of the viewport. This parameter is ignored if `Top` or `Left` is set to a non-empty string. |
| `Class` | `string` | The custom CSS class of the `<div class="k-window">` element. Use it to [override theme styles](slug:themes-override). Here is a [custom Window styling example](slug:window-kb-custom-css-styling). |
| `CloseOnOverlayClick` | `bool` | Sets if a modal Window will close when the user clicks on the modal overlay that covers the rest of the page content. |
| `ContainmentSelector` | `string` | A CSS selector that points to a unique HTML element on the page. The Window will render inside the specified container. Window resizing and dragging will be restricted by the boundaries of the specified container. Do not use `ContainmentSelector` with modal Windows. |
Expand Down Expand Up @@ -172,6 +171,7 @@ In Blazor, however, the render tree structure may be important. In some cases, t
* [Configure the Window position](slug:components/window/position)
* [Set the Window size, minimized, and maximized state](slug:components/window/size)
* [Handle Window events](slug:window-events)
* [Learn How to Programmatically Center the Window](slug:window-kb-center-programmatically)

## See Also

Expand Down
33 changes: 1 addition & 32 deletions components/window/position.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,11 @@ position: 2

The Window offers several ways to control its position:

* [`Centered` parameter](#centered)
* [`ContainmentSelector` parameter](#containmentselector)
* [`Top` and `Left` parameters](#top-and-left)

The Window renders [in the root of the application](slug:window-overview#important-notes) or in its [containment element](#containmentselector). If the app is using special CSS positioning, margins, or other offsets on the Window ancestors, these CSS styles may [affect the position of the Window](slug:troubleshooting-general-issues#wrong-popup-position).


## Centered

The `Centered` parameter determines if the Window displays centered in the viewport. The parameter value is `true` by default.

A centered Window applies the following CSS styles, which maintain the centered position even if the viewport size changes:

````CSS.skip-repl
.k-centered {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
````

If the `Top` or `Left` parameters are set and not empty, they take precedence over `Centered`. To center the Window dynamically through its `Centered` parameter, bind the `Top` and `Left` parameters too, so you can reset them to `string.Empty` or `null`.

>caption Center the Window

````RAZOR
<TelerikWindow Centered="true" Visible="true">
<WindowTitle>
Window Title
</WindowTitle>
<WindowContent>
A Centered Window
</WindowContent>
</TelerikWindow>
````


## ContainmentSelector

By default, users can drag and resize the Window without constraints. You can restrict the Window's visual position to the boundaries of a specific container:
Expand Down Expand Up @@ -127,3 +95,4 @@ When the [Window `ContainmentSelector` parameter is set](#containmentselector),

* [Live Demo: Window Position](https://demos.telerik.com/blazor-ui/window/position)
* [Live Demo: Constrain Window Movement](https://demos.telerik.com/blazor-ui/window/constrain-movement)
* [How to Center the Window Programmatically](slug:window-kb-center-programmatically)