-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Fix File Upload fatal #25361
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 File Upload fatal #25361
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
| import React from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
| import { | ||
| EuiForm, | ||
| EuiFlexGroup, | ||
| EuiFlexItem, | ||
| EuiImage, | ||
|
|
@@ -15,7 +16,10 @@ import { | |
| EuiButton, | ||
| EuiFieldText, | ||
| } from '@elastic/eui'; | ||
| import { Loading } from '../../../../public/components/loading'; | ||
|
|
||
| // TODO: (clintandrewhall) This is a quick fix for #25342 -- we should figure out how to use the overall component. | ||
| import { Loading } from '../../../../public/components/loading/loading'; | ||
|
|
||
| import { FileUpload } from '../../../../public/components/file_upload'; | ||
| import { elasticOutline } from '../../../lib/elastic_outline'; | ||
| import { resolveFromArgs } from '../../../../common/lib/resolve_dataurl'; | ||
|
|
@@ -123,18 +127,19 @@ class ImageUpload extends React.Component { | |
| } | ||
|
|
||
| const pasteImageUrl = urlTypeSrc ? ( | ||
| <form onSubmit={this.setSrcUrl} className="eui-textRight"> | ||
| <EuiForm onSubmit={this.setSrcUrl} className="eui-textRight"> | ||
| <EuiFieldText | ||
| compressed | ||
| value={this.state.url} | ||
| defaultValue={this.state.url} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We just had a lot of issues with uncontrolled forms, so my initial reaction here is fear of bringing them back ;). I know you touched on this in the description, but I don't really understand why this needs to be uncontrolled. Can you clarify why?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a |
||
| inputRef={ref => (this.inputRefs.srcUrlText = ref)} | ||
| placeholder="Image URL" | ||
| aria-label="Image URL" | ||
| /> | ||
| <EuiSpacer size="m" /> | ||
| <EuiButton type="submit" size="s" onClick={this.setSrcUrl}> | ||
| Set | ||
| </EuiButton> | ||
| </form> | ||
| </EuiForm> | ||
| ) : null; | ||
|
|
||
| const shouldPreview = | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.