antd

How to reset antd datepicker after submiting a value?

房东的猫 提交于 2019-12-11 18:43:16
问题 here i am providing my sample example working on codesandbox. How to reset a datepicker value after submitting a form? state = { setFieldValue: '' } onChange = (setFieldValue) => { this.setState({ setFieldValue: null }) } render() { const { values, handleSubmit } = this.props return ( <div align="center"> <Form onSubmit={handleSubmit}> <Field name="dateofbirth" label="dateOfBirth" component={DateInput} formitemlayout={formItemLayout} value={this.state.setFieldValue} onChange={this.onChange} /

Java heap space when uploading large file to server Spring boot with embedded Jetty

 ̄綄美尐妖づ 提交于 2019-12-11 17:39:42
问题 I need to upload a large file to the server, preferably in streaming mode, so that it does not load completely into RAM. Since now, when trying to upload a large file, an exception is thrown /manager/api/server/import/upload java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:3236) at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:118) at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93) at java.io.ByteArrayOutputStream

React / Ant Design - unable to Upload XLSX

牧云@^-^@ 提交于 2019-12-11 16:48:31
问题 I'm learning React and currently using ant design for my upload button but somehow it won't work ( it works normally without the design. My original code(working version): export default ({ addItem }) => { return ( <label className="btn"> <input type="file" onChange={e => { var reader = new FileReader(); reader.onload = event => { var data = event.target.result; var workbook = XLSX.read(data, { type: "binary", }); workbook.SheetNames.forEach(sheetName => { var XL_row_object = XLSX.utils.sheet

How to Remove Video Preview When User click on Delete in ReactJS

不打扰是莪最后的温柔 提交于 2019-12-11 15:35:44
问题 I am working on project in reactjs, Currently I am using ant-design form for selection of video and I implemented some logic when user click on video then display video to below but when user click on delete button and select another one the preview video is not remove with delete button . I will share my code please review it and Please help me Thanks Code <PhotoText>Select a Video to Upload</PhotoText> <FormItem> {getFieldDecorator('video', { rules: [ { required: true, message: 'Please

How to manage multiple navigation items states?

廉价感情. 提交于 2019-12-11 14:22:47
问题 I'm trying to implement a horizontal menu with antd components. When clicking the nav items the submenu is not showing correctly. Codesandbox demo. const MenuList = [ { name: "Navigation two - Submenu", subMenuRoutes: [ { name: "A- item1", url: "/item1Url1" }, { name: "A - item2", url: "/item1Url2" } ] }, { name: "Navigation Three - Submenu", subMenuRoutes: [ { name: "B- item1", url: "/item1Url1" }, { name: "B - item2", url: "/item1Url2" } ] } ]; function TextAreaManager() { const [showMenu,

How to set custom style to antd Rate Component

梦想的初衷 提交于 2019-12-11 12:15:12
问题 When I mouse over a star in Ant Design's Rate component it's size increases and on mouse out it goes back to the original size. This is probably due to an innate transform: scale(x) in the component. I want to stop this animation/behaviour of stars if I mouse over them. How can I achieve that? I have tried different element state in devtools but failed. I'm able to set custom width and height but I can't find something which can stop that animation/transform :/ . code sandbox .ant-rate-star

TS2339: Property does not exist on type {} when extending a class (of Antd)

房东的猫 提交于 2019-12-11 10:55:52
问题 I am quite new to Typescript, but I have to debug somebody else's code. It is about a component in components\ViewTable.tsx which worked previously, before updating TS/JS packages. It contains the following code \\ Lines 8-9 import { Table } from "antd"; const { Column, ColumnGroup } = Table; \\ Line 52 class MyTable extends Table<Interfaces.ViewEntry>; \\ ... export class ViewTable extends React.Component<ViewTableProps, ViewTableState> { render() { return ( <div> <div className="view-table"

Antd: How to override style of a single instance of a component

放肆的年华 提交于 2019-12-11 09:49:19
问题 I'm using webpack to import the antd.less file in a global App.less file. Then I override some global styles and webpack bundles everthing: // App.less @import "~antd/dist/antd.less"; @import "./fonts.css"; @import "./reactSplitPane.css"; @heading-color : fade(#000, 100%); @text-color : fade(#000, 100%); @text-color-secondary : fade(#000, 100%); @disabled-color : fade(#000, 25%); My webpack 2 config looks like that: { test: /\.less$/, use: ExtractTextPlugin.extract({ fallback: "style-loader",

Using react-input-mask with formik and formik-antd

馋奶兔 提交于 2019-12-11 07:46:35
问题 I'm using formik with @jbuschke/formik-antd . I need to apply a mask +7 (___) ___-__-__ to an input, so I would like to use react-input-mask . At the same time I need to parse the value and remove symbols except + and digits, so I handle onChange and setFieldValue myself. I can get changedValue in the console log, but on submit I'm getting the initial value, not the changed one. Here is my code and the demo: const CustomInput = props => ( <InputMask {...props}>{inputProps => <Input {..

Select child rows when we select on the parent row using rowSelection in antd table

廉价感情. 提交于 2019-12-11 07:38:38
问题 I'm trying rowselection reactjs using antd table.I'm trying this one ant-components-table-demo-expand-children when I select parent row it must select child rows of that parent (it should tick mark the child rows). this.rowSelection = { onSelect: (record, selected, selectedRows) => this.onSelectChange(record, selected, selectedRows), onSelectAll: (selected, selectedRows, changeRows) => this.allRowsSelected(selected, selectedRows, changeRows) }; <Table rowKey={data._id} columns={this.columns1}