Controlled TextaArea componenet with autoSize and rows properties.
const App = () => {
const [state, setState] = useState();
return (
<TextArea
value={state}
onChange={(e) => setState(e.value)}
autoSize={true}
rows={2}
/>
);
};
Add couple text lines to extend TextArea size and remove these empty lines in any way.
Content from TextArea field is removed but TextArea height stays the same, doesn't come back to it's initial value. It's different comparing to example from your docs where example contains uncontrolled component.
Controlled TextaArea componenet with autoSize and rows properties.
const App = () => {
const [state, setState] = useState();
return (
<TextArea
value={state}
onChange={(e) => setState(e.value)}
autoSize={true}
rows={4}
/>
);
};
and styles like these
.k-textarea textarea {
border: 1px solid blue;
}
Start typing anything
Height of textarea component is decreasing
Hello,
Our team is using MobX-State-Tree (MST) and KendoReact TreeList control with virtual scrolling enabled. According to documentation MST model stores data as an observable array (https://mobx-state-tree.js.org/API/#array and https://mobx.js.org/api.html#observablearray).
The MST model’s field ‘tree’ is not a regular array, but a LegacyObservableArray.
From UI standpoint:
initially all tree nodes are collapsed
user clicks on i.e. 3rd tree node
selection is not displayed on any tree node (3rd node expected to be selected)
user expands 1st tree node - selection is set on the 3rd tree node
The following warning appears in the browser console.
Warning: Failed prop type: Invalid prop `data` of type `object` supplied to `TreeList`, expected `array`.
in TreeList (created by wrappedComponent)
in wrappedComponent (created by wrappedComponent)
in div (created by wrappedComponent)
in div (created by wrappedComponent)
in wrappedComponent
Model is defined as:
const TreeViewModel = types
.model('TreeViewModel', {
selectedItemUUID: types.maybe(types.string),
tree: types.optional(types.array(TreeNodeModel), []),
isLoaded: types.maybe(types.optional(types.boolean, false)),
treeTypes: types.optional(types.array(TreeNodeTypeModel), []),
})
.views((self) => ({
get treeCollection(): any {
return self.tree;
},
}))
Component is defined as:
return (<>
{!viewModel.isLoaded && loadingPanel}
<div className='treeListContainer' ref={stageCanvasRef}>
{treeListContainerHeight && <TreeList
style={{ maxHeight: `${treeListContainerHeight}px`, overflow: 'auto', }}
data={viewModel.treeCollection}
expandField={expandField}
subItemsField={subItemsField}
columns={columns}
selectedField={selectedField}
rowHeight={40}
scrollable="virtual"
/>}
</div>
</>);
The following workaround allows converting an observable array to a regular array.
.views((self) => ({
get treeCollection(): any {
return JSON.parse(JSON.stringify(self.tree)); // or self.tree.slice()
},
}))
This solution affects performance due to array copy.
Besides this TreeList uses an array copy. User’s selection and expanding don’t trigger related changes in the initial observable array in the model.
Related event handlers (i.e. onSelectionChange, onExpandChange) should be extended to make appropriate changes in the MST model.
Can you please extend KendoReact controls to support observable arrays?
Is there a better solution?
Looking at the JSDoc for for `toDataSourceRequestString` and `toDataSourceRequest`, they both appear to have JSDoc above them, showing the parameter as:
* @param {DataRequestState} state - The state that will be serialized.
Should this actually have `@param {DataSourceRequestState}`?
Hello,
I'm trying to implement an accessible table using your Grid React component. The idea is for the users to be able to navigate the table using the keyboard if need be. Because we are a government contractor we have to make our product accessible and, testable using the Government issued tool for testing, ANDI.
When I use a normal table, I can implement scopes in the table header, either for the column or the row and thus create relationships between headers and cells as well as, use the keyboard to navigate the entire table.
When the same table is implemented with the Grid component, there are no scopes in the header then again, both header and body are separate even though they reside inside a div with role=grid on it which in turn, contains two divs, one for the header and one for the body each in turn, implementing a table: one for what would be the headers and one for what would be the body. I'm attaching screenshots even though I'm sure you know the product.
The fact that both the <thead> and the <tbody> reside in different places, even though they are within the grid, makes it impossible to add associations furthermore, we're using a data-table and the grid. I tried using different props but, as long as both the header and the body are separate, the ANDI tools can't find the table.
Question is, is there a way to make this table truly accessible just as a one created using the semantic table tags?
A few suggestions for the React Grid (as of v5.0.1) to help devs conform to accessibility compliance...
1) Standard HTML tables can contains a <caption> element, which screenreaders will use as the descriptive name of the table. Kendo Grid does not appear to have any way to name the table.
2) Related to number 1, other ways to assign a descriptive name to a table may be to include a `title`, `aria-label` or `aria-describedby` attributes, but none of these work on <Grid>. They are not rendered into the HTML if passed as props.
3) Allow GridCell and other Cell components to take `children` to render. The current documentation generally advises us to override the `cell={}` prop on a GridColumn for custom cell rendering. What is not listed in the docs is that doing what seems like the obvious thing:
<GridColumn cell={() => <td>myContent</td>} />
actually breaks accessibility. At a minimum the cell MUST get the attributes
role={'gridcell'}
aria-colindex={props.ariaColumnIndex}
to have the table actually be represented correctly in most screen readers. The Kendo <GridCell> component would normally add these, but only renders the field from the dataItem. It can only render custom data if the `render` prop is set, in which case it yet again does not render the `<td role= aria-colindex=` portions on it's own.
What I'm getting at is, everyone who ever wanted to render a custom cell in Keno Grid always had to make their own cell component that added at least the `role` and `aria-colindex` attributes, and if they didn't, they probably unknowingly broke accessibility.
Kendo could make this clearer in the docs (including the accessibility page for the Grid), and could easily alter GridCell to render `children` if they are passed. Then we could do:
<GridColumn cell={<GridCell><button>yay</button></GridCell>} />
and have the rendered HTML:
<td colSpan="1" style="" class="" role="gridcell" aria-colindex="1" aria-selected="false"><button>yay</button></td>
I think in GridCell this would be as easy as changing:
defaultRendering = (
<td
colSpan={props.colSpan}
style={props.style}
className={className}
role={'gridcell'}
aria-colindex={props.ariaColumnIndex}
aria-selected={props.isSelected}
{...{[GRID_COL_INDEX_ATTRIBUTE]: props.columnIndex}}
{...navigationAttributes}
>
{dataAsString}
</td>
defaultRendering = (
<td
colSpan={props.colSpan}
style={props.style}
className={className}
role={'gridcell'}
aria-colindex={props.ariaColumnIndex}
aria-selected={props.isSelected}
{...{[GRID_COL_INDEX_ATTRIBUTE]: props.columnIndex}}
{...navigationAttributes}
>
{children || dataAsString}
</td>
All of the Kendo components that "hide" content (tab views, collapse panels, etc) don't actually hide any content. They require us to not render any children.
<ExpansionPanel
{expanded === item.id && (
<ExpansionPanelContent>
This just strikes me as an odd design decision. I guess I don't understand the point of these components if they don't do the 1 thing they are supposed to do; hide portions of the content.
Un-rendering the content is usually not desirable. The contents are often still important. Possibly for SEO purposes, A11y, or if they are part of a Form:
<Form
render={() => {
<FormElement>
<ExpansionPanel>
{expanded === item.id && (
<ExpansionPanelContent>
<Field
name={"firstName"}
component={Input}
validator={() => 'always invalid'}
/>
</ExpansionPanelContent>
</ExpansionPanel>
</FormElement>
}}
/>
This makes the Form valid as long as the panel is collapsed.
Can check out how Bootstrap collapse panels work to see how most people would expect these components to behave. The contents is rendered into the DOM and JS and CSS are used to hide it. There should be a way to achieve this same behavior with Kendo.
As a workaround I end up having to do my own CSS/SASS to hide the contents
.k-expander {
.k-expander-content-wrapper {
height: 0;
overflow: hidden;
}
&.k-expanded {
.k-expander-content-wrapper {
height: auto;
}
}
}
Hello
Currently, the KendoReact Grid can only select all columns as shown in this demo:
https://www.telerik.com/kendo-react-ui/components/grid/selection/#toc-customizing-the-selection
We wish to be able to select only specific columns programmatically.
There is an inconsistency with the DateRange picker in the way element focus is set when closing the date selection popup by mouse vs keyboard. When using the mouse to close the date range selection popup, element focus becomes lost/reset.
You can simulate this from the example page https://www.telerik.com/kendo-react-ui/components/dateinputs/daterangepicker/
Steps to simulate good behavior (this works correctly):
* click the 'from' input text element (causes the popup to open and the text input to have focus)
* press 'escape' to close the popup (the popup is closed, and the 'from' input element retains focus)
* press 'tab' (focus moves to the 'to' text input element)
Steps to simulate behavior that could be improved:
* click or tab into the 'from' input element (causes the popup to open and the text input to have focus)
* click (with the mouse) outside the popup to close it (the popup is closed, and focus appears to be lost.)
* press 'tab' (focus moves to the 'from' input element again because we are back at the beginning of the tab order list)
This input can lead you into a tab order loop if you mix pressing 'tab' to advance focus, and using the mouse to click to close the date selection popup.
Feature request: when clicking to close the popup, element focus should be retained in the 'from' or 'to' text input; whichever had focus before the popup close, the same as pressing 'escape' to close the popup.
I use a Datepicker with 'he' loclae. It works fine, but the week's days are displayed from left to right instead of right to left as expected.
I tried to add className = 'k-rtl' but it did not help.
Is there a way to change that?
Here is a demonstration of the problem:
https://stackblitz.com/edit/react-vkzwzo?file=app%2Fmain.jsx
Set up a TimePicker with a `min` and `max`. For example
min={new Date(0, 0, 0, 0, 0)} max={new Date(0, 0, 0, 5, 0)}
Click on the text input to focus the 'hours' portion.
Roll the mouse scrollwheel up/down to change the hours.
You can 'scroll' past 5:00 and set the time to anything above the max.
You can also use the keyboard to enter any number outside the min/max.
Is this the expected behavior? Do we always have to add our own validation to check the min/max ourselves?
A TimePicker control will take all scroll events if the mouse cursor is over it, whether the element has focus or not, and prevent the scroll from bubbling up to the page. This prevents a page from scrolling as soon as the mouse cursor touches a TimePicker.
Using Kendo rect v5.1.0 in FireFox v98 on OSX. (Issue does not happen in Chrome)
You can view the problem in the demo page: https://www.telerik.com/kendo-react-ui/components/dateinputs/timepicker/
Just try to scroll down the view, and as soon as the TimePicker is under the mouse cursor, the page can no longer be scrolled until you move the cursor off the control.
On this page: https://www.telerik.com/kendo-react-ui/getting-started/
There's a syntax mismatch in end-of-line semicolons.
This line ends with a semicolon:
```js
import '@progress/kendo-theme-default/dist/all.css';
```
This line does not end with a semicolon:
```js
import { Calendar } from '@progress/kendo-react-dateinputs'
```
All teams that I know of consider it to be an error to do both ways in the same file.
The solution is to pick one way then be consistent. The broader solution is to use a linter, such as ESLint, that can process the code to ensure you're using your expected syntax and formatting.
Hi there,
I can see there is a column chooser component for the Angular Data Grid e.g. https://www.telerik.com/kendo-angular-ui/components/grid/columns/menu/#toc-column-chooser-item but there is not an equivalent for the React Data Grid (unless you code it yourself).
The DevExpress React Grid does have this feature https://devexpress.github.io/devextreme-reactive/react/grid/docs/guides/column-visibility/ so we were wondering if such a thing is planned React Data Grid?
Thanks very much,
James
Hello Support Team,
We are migrating our ASP MVC application to React JS and need your help in scheduler time-line view. In ASP MVC you provided the functionality to render the custom template for Resource Title or we can say for the user name. But we are unable to implement the same functionality in react js, and this is the important module of our application. Our application client strictly say he needs 100% same application as it is in ASP MVC version.
We request you to please add this feature to the Scheduler in the coming updates & this would be useful to the other users also.
Thank You.
Hi Team,
I am facing one challenge to create a Calendar view with multiple date selection with multiple colors.
Please suggest and share class component references to achieve the same.
Please refer attached video or do let me know if you have any questions.
Thanks.
If you show a Grid with no rows, the Kendo Grid displays a `k-grid-norecords` row. The generated HTML for this is:
<tr class="k-grid-norecords" aria-rowindex="2"><td colspan="5">No records available</td></tr>
If you run Axe accessibility checks (axe-core 4.4.1) against this, it reports:
Impact: critical
Elements must only use allowed ARIA attributes
ARIA attribute is not allowed: aria-rowindex="2"