Commit Graph
516 Commits
Author SHA1 Message Date
Ben Alpert 633125fd0d Use innerHTML not innerText in test 2013-12-25 22:47:10 -07:00
Ben Alpert 30f566392b Extract out wrapUserProvidedKey for clarity 2013-12-25 22:32:43 -07:00
Ben Alpert 6fae670d19 Make shouldUpdateReactComponent key logic clearer
...and inline getComponentKey into traverseAllChildren.js.
2013-12-25 22:25:20 -07:00
Ben Alpert b0431a51ca Respect 'key' prop for object identity
Now when a `key` prop appears, its value is always honored. This means that in the root component or as an only child, changing key will cause remounting; in a `children` object, the `key` prop will be joined with the object key to form a two-part key.

Fixes #590.
2013-12-25 22:24:10 -07:00
Christopher Chedeau 02e47ebd00 Merge pull request #713 from syranide/nokeytransfer
transferPropsTo should never transfer the "key" property
2013-12-25 20:46:30 -08:00
Andreas Svensson 374c9ba658 transferPropsTo should never transfer the key property 2013-12-26 00:12:22 +01:00
Christopher Chedeau a6d8c00b1a Merge pull request #702 from syranide/lessmice
Removed unnecessary cleanup in isEventSupported
2013-12-23 19:30:16 -08:00
Andreas Svensson 63ca84e5af Removed unnecessary cleanup in isEventSupported 2013-12-24 01:02:24 +01:00
Pete Hunt 128a35dff9 Merge pull request #642 from Cartas/master
ReactTransitionGroup can handle components being re-added before 'leave' transition has completed.
2013-12-23 15:36:28 -08:00
Timothy Yung 9e0987cd9b Merge pull request #607 from syranide/html5key
Polyfill and normalize HTML5 "key", deprecates which and keyCode
2013-12-23 11:11:12 -08:00
Ben Newman 82a26ada65 Merge pull request #684 from syranide/ie8dangerousinnerhtml
Use feature detection and more robust recovering of whitespace for innerHTML in IE8.
2013-12-23 11:07:51 -08:00
Andreas Svensson 1f2d57d6a4 Use feature detection and more robust recovering of whitespace for innerHTML in IE8 2013-12-22 20:30:59 +01:00
Logan Allen ab88dd19d3 Added property to non-standard attributes
Fixes issue #655
2013-12-21 22:24:31 -05:00
Mouad Debbar d914522ae4 A new prop type for React Components
Since we can use props to pass React Components, we should have a better way of validating these props than just `object`. Having a prop type `component` will allow us to safely assume that the passed prop IS a component.
2013-12-20 18:13:21 -08:00
Tim Yung 3431e3f847 Add createMarkupForID
This is a follow-up the to previous commit and does two things:

 - Moves `ReactMount.ATTR_NAME` to `DOMProperty.ID_ATTRIBUTE_NAME`.
 - Adds `DOMPropertyOperations.createMarkupForID` and uses it.
2013-12-20 18:12:48 -08:00
Tim Yung 9d119577ea Consolidate ID Attribute Markup Generation
We have this really nice method for safely creating markup for an HTML
attribute, `DOMPropertyOperations.createMarkupForProperty(...)`. Let's
use it to create the ID attribute markup, too.
2013-12-20 18:12:37 -08:00
Jun, WU 3c5710193c Fix a perf issue of <select multiple />
`indexOf` was used inside a loop. Use an object and
`hasOwnProperty` instead.
2013-12-21 01:04:31 +08:00
WU Jun 9a4a8aa71a Do not automatically select other options
For <select multiple />, `value` is an array and should not be
converted to a string.
2013-12-21 01:04:31 +08:00
Pete Hunt 294bac537d Merge pull request #668 from nicholasbs/fix-docs-typo
Fix typos
2013-12-17 18:39:14 -08:00
Tim Yung 41230ef5dd A new helper for tests: createHierarchyRenderer
We aren't using this in any of the React tests, but we've found it
useful testing product code.
2013-12-17 18:07:53 -08:00
Thomas Aylott 7f3d4f0340 fixes ReactTextComponent rootID unescapedness 2013-12-17 05:07:49 -05:00
Thomas Aylott 346c8f5e6e test case for ReactTextComponent rootID escaping 2013-12-17 05:05:28 -05:00
Nicholas Bergson-Shilcock 93eb6a5637 Fix typo in comments (ot -> to) 2013-12-15 12:12:38 -05:00
Paul O’Shannessy 5a5137ded4 Merge pull request #651 from fabiomcosta/patch-2
Improving never seen error message
2013-12-13 10:23:46 -08:00
Paul O’Shannessy c2920ba84c Merge pull request #653 from fabiomcosta/patch-3
match -> test
2013-12-12 15:33:31 -08:00
Fabio M. Costa 39037eedd1 URL -> url 2013-12-12 15:29:29 -08:00
Ben Newman 7c95194ec0 Merge pull request #637 from cpojer/use-rest-params
Use Rest Parameters where it makes sense
2013-12-12 14:53:50 -08:00
Josh Duck 8b0af9b5de Fix SelectEventPlugin
mouseup was not fired when context menu showed, so select events stopped being fired.
2013-12-11 13:46:11 -08:00
Tim Yung 02de96f012 Fix Merging propTypes, contextTypes, and childContextTypes
This fixes merging of `propTypes`, `contextTypes`, and `childContextTypes` so that we actually merge (instead of only taking the component or last mixin).
2013-12-11 13:45:55 -08:00
Ben Alpert e92ce38cf1 Add loop property 2013-12-11 11:46:16 -08:00
cpojer decb49a202 Use rest parameters whenever it makes sense. 2013-12-11 10:30:10 -08:00
Fabio M. Costa c7129fd377 match -> test
Using RegExp method `test` because this is what is wanted
2013-12-11 00:43:31 -08:00
Fabio M. Costa 4b3fa413a1 Improving never seen error message
Removing repeating "support it" and fixing camelCase method name
2013-12-10 21:07:41 -08:00
Paul O’Shannessy 80e0e2a13f Clean trailing space and lint 2013-12-09 15:54:16 -08:00
Paul O’Shannessy 5c65abfbac Merge remote-tracking branch 'syranide/textarearows' 2013-12-09 15:51:38 -08:00
Paul O’Shannessy 153b75f186 Bump version to 0.9.0-alpha
This is trunk, which will be 0.9. We'll have to cherry-pick this whole
thing into a 0.8 branch.
2013-12-06 15:11:25 -08:00
petehunt ef339c9cc4 Version bump, make tests work 2013-12-06 11:56:30 -08:00
Paul O’Shannessy 9270d3d56e Merge pull request #592 from spicyj/guard-fn
ReactErrorUtils: In prod, just return the original
2013-12-06 11:31:02 -08:00
Cartas 7d8190f56e Updated the animation-fix to account for transitionEnter being false. 2013-12-06 15:37:38 +01:00
Cartas c313a1045d Nodes that have had their child removed already, but then get given a new one no longer bug-out.
In the case of having an animated node which is, after the leave-transition has been activated, then re-added in a render call causes React to 'break'.  This is especially noticeable if you spam to removal and re-addition of an item in a ReactTransitionGroup.

This fix simply stops the leave transition and restarts the enter transition.
2013-12-06 14:46:33 +01:00
Paul Shen 12e765dd27 Revert "Don't mutate passed-in props"
This reverts https://github.com/facebook/react/pull/576

This approach mutates the default props for the instance on each update,
which causes incorrect behavior. discussed with @balpert. can look into
cloning but this unbreaks.
2013-12-05 16:53:43 -08:00
Paul O’Shannessy 2ebbbc5145 Followup fix for lint 2013-12-05 15:55:49 -08:00
Ben Alpert d0883c8cc7 Use depth (not owner) to check for root components
Fixes #557.
2013-12-05 13:36:29 -08:00
Andreas Svensson 27b8e7a6f4 corrections 2013-12-05 19:40:48 +01:00
Andreas Svensson 4d6d4b54d6 Fix ReactDOMTextarea missing "rows" and "cols" attribute, incorrect "size" property 2013-12-05 18:36:48 +01:00
Andreas Svensson e060eabb01 Add HAS_POSITIVE_NUMERIC_VALUE to DOMProperty and normalize behavior of null values
Uniformly remove null values, rather than sometimes set/remove, could potentially assign 'null' or 'undefined'
2013-12-05 18:36:46 +01:00
Marshall Roch d17bd176a2 Remove support for putting mixins, propTypes, etc. in 'statics'
This leaves statics as a way to define static methods and properties
that will be accessible on the return value of `React.createClass`
without changing the current spec.
2013-12-04 20:27:44 -08:00
Sean Kinsey c2e48740fc [ReactTransitionGroup] Add onTransitionEnter and onTransitionLeave
It is valuable to know when the number of children in a TransitionGroup is going
to increase or decrease, since we might want to apply extra animations.
For instance, when used with overflow:auto, we might want to apply different css
based on it overflowing or not - to do this we need to calculate this after new
nodes has entered and after nodes has been removed.
2013-12-04 20:27:28 -08:00
John Watson bf24dc33f7 Separate replaceState invariant violations
It'd be nice if we knew which error we were hitting when this invariant hit.
2013-12-04 20:27:24 -08:00
Marshall Roch e3ad088ff3 Remove deprecation warning for React statics 2013-12-04 20:27:19 -08:00