Fix Incorrect State Update in Sketch/index.js, Typo in Image Selector #281
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses two bugs (and leaves a third unsolved, but slightly-better solved):
As @jamieliu386 reported, there is a bug involving controlled vs. uncontrolled inputs when the Create, Edit, or Delete Sketch modals are left. This is because previously, they (for some reason) updated the input values in the modal after they are closed, which is when the internals are unmounted by
react-modal
. I fixed this by... not doing that. This resolves the problem forEditSketch
andConfirmDelete
, but there are lingering problems inCreateSketch
(which I will not deal with in this PR).There was a small typo involving
maxWidth
instead ofmax-width
for a CSS-in-JS property inImageSelector
; this fixes that typo.A general observation is that all of these modals are really really poorly coded and probably need an entire refactor. Slow and steady wins the race.