         if not @props.assignments?
             return
         v = immutable_to_list(@props.assignments, 'assignment_id')
-        if @state.search
-            words = misc.split(@state.search.toLowerCase())
+        search = (@state.search ? '').trim().toLowerCase()
+        if search
+            words = misc.split(search)
             matches = (x) ->  # TODO: refactor with student search, etc.
                 k = x.path.toLowerCase()
                 for w in words


        # Copy the files for the given assignment_id from the given student to the
        # corresponding collection folder.
        copy_assignment_from_student: (assignment_id, student_id) =>

        # Copy the files for the given assignment_id to the given student. If
        # the student project doesn't exist yet, it will be created.
        copy_assignment_to_student: (assignment_id, student_id, cb) =>
            error = (err) => err="copy to student: #{err}"; @set_error(err); cb?(err)
            if not @_store_is_initialized()
                return error("store not yet initialized")
            if not student = store.get_student(student_id)
                return error("no student")
            if not assignment = store.get_assignment(assignment_id)
                return error("no assignment")
            student_project_id = student.get('project_id')
            async.series([
                (cb) =>
                    if not student_project_id?
                        # student project doesn't exist, so try to create it.
                        @create_student_project student_id, (err, x) =>
                            student_project_id = x; cb(err)
                    else
                        cb()
                (cb) =>
                    # Now copy files to student project
                    salvus_client.copy_path_between_projects
                        src_project_id    : project_id
                        src_path          : assignment.get('path')

        <Button onClick={(e)=>e.preventDefault();@setState(more:false)}>
            <Icon name="times" />
        </Button>

    assign_assignment: ->
        # assign assignment to all (non-deleted) students
        @props.flux.getActions(@props.name).copy_assignment_to_all_students(@props.assignment)

    render_assign_button: ->
        <Button onClick={@assign_assignment}>
