Skip to content

Commit 4dfaea0

Browse files
committed
Remove {...props} from input and svg on Checkbox, Input, and UtilityIcon
1 parent e8ada8b commit 4dfaea0

File tree

4 files changed

+34
-6
lines changed

4 files changed

+34
-6
lines changed

components/card/filter/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1414
import React from 'react';
1515

1616
import Input from '../../forms/input';
17+
import InputIcon from '../../icon/input-icon';
1718

1819
// Removes the need for `PropTypes`.
1920
const { PropTypes } = React;
@@ -35,8 +36,7 @@ const Filter = (props) => {
3536
<Input
3637
{...rest}
3738
assistiveText={placeholder}
38-
iconCategory="utility"
39-
iconName="search"
39+
iconLeft={<InputIcon name="search" category="utility" />}
4040
id={id}
4141
onChange={onChange}
4242
placeholder={placeholder}

components/forms/checkbox/index.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ const Checkbox = React.createClass({
127127
'slds-has-error': errorText
128128
},
129129
className)}
130-
onKeyDown={this.handleKeyDown}
131130
>
132131
<div className="slds-form-element__control">
133132
<span className="slds-checkbox">

components/forms/input/index.jsx

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ const Input = React.createClass({
9797
* This label appears above the input.
9898
*/
9999
label: PropTypes.string,
100+
onBlur: PropTypes.func,
100101
/**
101102
* This callback fires when the input changes. The synthetic React event will be the first parameter to the callback. You will probably want to reference `event.target.value` in your callback. No custom data object is provided.
102103
*/
@@ -105,10 +106,19 @@ const Input = React.createClass({
105106
* This event fires when the input is clicked.
106107
*/
107108
onClick: PropTypes.func,
109+
onFocus: PropTypes.func,
110+
onInput: PropTypes.func,
111+
onInvalid: PropTypes.func,
112+
onKeyDown: PropTypes.func,
113+
onKeyPress: PropTypes.func,
114+
onKeyUp: PropTypes.func,
115+
onSelect: PropTypes.func,
116+
onSubmit: PropTypes.func,
108117
/**
109118
* Text that will appear in an empty input.
110119
*/
111120
placeholder: PropTypes.string,
121+
maxLength: PropTypes.string,
112122
/**
113123
* Name of the submitted form parameter.
114124
*/
@@ -203,8 +213,18 @@ const Input = React.createClass({
203213
inlineEditTrigger, // eslint-disable-line react/prop-types
204214
inputRef, // eslint-disable-line react/prop-types
205215
label,
216+
onBlur,
206217
onChange,
207218
onClick,
219+
onFocus,
220+
onInput,
221+
onInvalid,
222+
onKeyDown,
223+
onKeyPress,
224+
onKeyUp,
225+
onSelect,
226+
onSubmit,
227+
maxLength,
208228
name,
209229
placeholder,
210230
readOnly,
@@ -255,15 +275,24 @@ const Input = React.createClass({
255275
{hasLeftIcon ? this.getIconRender('left', 'iconLeft') : null}
256276

257277
{!readOnly && <input
258-
{...props}
259278
aria-controls={ariaControls}
260279
aria-owns={ariaOwns}
261280
className="slds-input"
262281
disabled={disabled}
263282
id={this.getId()}
283+
maxLength={maxLength}
284+
name={name}
285+
onBlur={onBlur}
264286
onChange={onChange}
265287
onClick={onClick}
266-
name={name}
288+
onFocus={onFocus}
289+
onInput={onInput}
290+
onInvalid={onInvalid}
291+
onKeyDown={onKeyDown}
292+
onKeyPress={onKeyPress}
293+
onKeyUp={onKeyUp}
294+
onSelect={onSelect}
295+
onSubmit={onSubmit}
267296
placeholder={placeholder}
268297
ref={inputRef}
269298
required={required}

components/utilities/utility-icon/svg.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ module.exports = React.createClass({
6767
},
6868

6969
getSVG ({ viewBox, ...rest }, props) {
70-
return <svg {...props} viewBox={viewBox}>{this.getShapes(rest)}</svg>;
70+
return <svg className={props.className} viewBox={viewBox}>{this.getShapes(rest)}</svg>;
7171
},
7272

7373
render () {

0 commit comments

Comments
 (0)