Fixes the bug when only first child is shown

I've rewritten ellipsis function because I wasn't able
to work with the old implementation. The new one works
ok for all my examples + the buggy one when more than
one child needs to be shown but it's only the first one
that is shown.