• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zulip / zulip-mobile / 7473
47%

Build:
DEFAULT BRANCH: master
Ran 17 Nov 2018 01:57AM UTC
Jobs 1
Files 367
Run time 24s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
7473

push

travis-ci

gnprice
composebox: On hide, keep Inputs mounted, just invisible.

Fixes #2861.

When `canSend` property is `false` we hide the ComposeBox component.
Then after it appears again the contents of both topic and message
Inputs are missing.

This issue exists only with our uncontrolled Input.

The cause is quite curious. We correctly initialize the inputs
on `componentDidMount`. So the component is working correctly on
initial render. What is messing it up is that if `canSend` becomes
`false` we do render a `null` (so nothing). This happens when we
are refreshing the state, on `APP_REFRESH` called on broken queues,
but can happen in other cases too (any case that makes `canSend` be
`false`).

When we show the compose box again, since we handle the show/no show
logic inside the component's `render`, the lifecycle event
`componentDidMount` is not called again. Thus we do not initialize the
values of the new Input components for the message topic and content.

There are several approaches to fixing this:
 * take the `canSend` logic ouside of the component. On each change
   the whole component will get unmounted and the `componentDidMount`
   will be called again - not a bad solution
 * handle the `false` to `true` transition of the value inside the
   `componentWillReceiveProps` - would work, but we are trying to get
   rid of this funcion, and also makes the logic too convoluted
 * do not unmount the Inputs when hiding - the chosen solution

When we need to hide the component, instead of not rendering it at
all, we just hide it - setting the `opacity` to 0 does that.
We also set `position` to `absolute` so it does not take up space
visually.

Tested both on iOS and Android and works well.

1415 of 2957 branches covered (47.85%)

Branch coverage included in aggregate %.

4826 of 6589 relevant lines covered (73.24%)

38.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 7473.1 (COVERALLS_REPO_TOKEN=4eYQDtWoBJlDz2QkxoQ2UcnmJFcOB7zkv) 17 Nov 2018 01:57AM UTC 0
65.38
Travis Job 7473.1
Source Files on build 7473
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #7473
  • 824c908c on github
  • Prev Build on master (#7471)
  • Next Build on master (#7475)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc