Open
Bug 1302226
Opened 8 years ago
Updated 2 years ago
Convert Storage inspector toolbar to HTML
Categories
(DevTools :: Storage Inspector, enhancement, P2)
DevTools
Storage Inspector
Tracking
(Not tracked)
NEW
People
(Reporter: ntim, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
11.31 KB,
patch
|
Details | Diff | Splinter Review |
No description provided.
Priority: -- → P2
Reporter | ||
Comment 1•8 years ago
|
||
Still need to fix the test.
Attachment #8794141 -
Flags: review?(mratcliffe)
Attachment #8794141 -
Flags: review?(jsnajdr)
Comment 2•8 years ago
|
||
Comment on attachment 8794141 [details] [diff] [review] Patch (WIP) Review of attachment 8794141 [details] [diff] [review]: ----------------------------------------------------------------- ::: devtools/client/shared/components/search-box.js @@ +33,5 @@ > + }); > + shortcuts.on(this.props.keyShortcut, (name, event) => { > + event.preventDefault(); > + this.refs.input.focus(); > + }); The KeyShortcuts object adds a 'keydown' event listener to the window. You need to call shortcuts.destroy() in componentWillUnmount. Otherwise, the listener will leak. @@ +50,5 @@ > + this.refs["clear-button"].hidden = !hasValue; > + if (hasValue && this.props.hasNoMatch) { > + this.refs.input.classList.add("devtools-style-searchbox-no-match"); > + } > + }, You cannot manipulate the DOM elements that are rendered and owned by React. The changes will be overwritten next time React calls "render" and updates the DOM, leading to random bugs. If the "input" or "clear-button" element has a "filled" class or is hidden or whatever, they must be set on the elements returned from the render() method. The render() method will derive the desired markup from the props and state of the component. In this case, the SearchBox component should have a state with property "hasValue", which can be changed by calling setState(). @@ +53,5 @@ > + } > + }, > + > + onChange() { > + this.updateSearchBoxState(); Replace this with: this.setState({ hasValue: this.refs.input.value.length > 0 }); The rest of the updateSearchBoxState() method will move to render(). @@ +75,5 @@ > + }, > + > + onClearButtonClick() { > + this.refs.input.value = ""; > + this.onChange(); When you change the input.value from a script like this, doesn't the input fire a "change" event? Explicit call to this.onChange() is then not necessary.
Attachment #8794141 -
Flags: review?(jsnajdr) → review-
Comment on attachment 8794141 [details] [diff] [review] Patch (WIP) Review of attachment 8794141 [details] [diff] [review]: ----------------------------------------------------------------- ::: devtools/client/shared/components/search-box.js @@ +75,5 @@ > + }, > + > + onClearButtonClick() { > + this.refs.input.value = ""; > + this.onChange(); @jsnajdr: Nope... change events are not triggered when a value is changed programmatically.
Attachment #8794141 -
Flags: review?(mratcliffe)
Reporter | ||
Comment 4•8 years ago
|
||
Attachment #8794141 -
Attachment is obsolete: true
Reporter | ||
Comment 5•8 years ago
|
||
(In reply to Tim Nguyen :ntim (use needinfo?) from comment #4) > Created attachment 8800347 [details] [diff] [review] > WIP patch Stuff that needs to be done: - Fix the tests - Fix the handling of changing hosts
Reporter | ||
Updated•8 years ago
|
Assignee: ntim.bugs → nobody
Status: ASSIGNED → NEW
Blocks: 1312444
Reporter | ||
Comment 6•8 years ago
|
||
The shared search box has been added in bug 1154789 at devtools/client/shared/components/search-box.js
No longer blocks: 1312444
Updated•7 years ago
|
Severity: normal → enhancement
Has Regression Range: --- → irrelevant
Has STR: --- → irrelevant
OS: Unspecified → All
Hardware: Unspecified → All
Updated•6 years ago
|
Product: Firefox → DevTools
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•