-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Conversation
jacogr
commented
Mar 2, 2017
•
edited
Loading
edited
- Close when clicking anywhere in the body pane
- Close when clicking the address (previously only focusses)
- Close when pasting a valid address
- Fix invalid proptypes handling in InputAddressSelect
- Filtering, closing & re-opening now clears the filter (Thanks @ngotchac)
@@ -613,6 +617,10 @@ class AddressSelect extends Component { | |||
focusedItem: null, | |||
inputValue: value | |||
}); | |||
|
|||
if (apiutil.isAddressValid(value)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not importing directly isAddressValid
(I think that's how it's done pretty much everywhere)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure it is "the default" - have not done it once myself. (And I do prefer the above format to all the direct function imports - can see exactly where things are from. It gets messy at some point when you have a large number - obviously not the case here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite true, thought so. It's imported twice as apiutil
and once as util
(for use with isAddressValid
) though
@@ -28,6 +28,7 @@ import styles from './accountCard.css'; | |||
export default class AccountCard extends Component { | |||
static propTypes = { | |||
account: PropTypes.object.isRequired, | |||
allowAddressClick: PropTypes.bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's not very common practice, but could we add static defaultProps
with this allowAddressClick
set to false
? I think it would be a bit more obvious what the default behavior is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, like being explicit, adding it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(It's defaultProps
not defaultPropTypes
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sigh Sorry, I setup my auto-complete wrongly. (Happens when you do it late at night.) Updating. (Edit: thanks for the fix)
Ok, so I fixed to filter issue (not reset filter on close), and prevented the default click & select action when selecting text. It seems that there still are some parts of the pop-up where clicking doesn't do anything. Not sure if that's wanted or not |