Bug 107788 - Easy means to clear a selection
Summary: Easy means to clear a selection
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
5.2.5.1 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Forms
  Show dependency treegraph
 
Reported: 2017-05-12 00:30 UTC by Howard Johnson
Modified: 2018-06-27 08:49 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Form with a Table control with a list box named Color ID. (11.16 KB, application/vnd.oasis.opendocument.database)
2017-05-12 00:30 UTC, Howard Johnson
Details
Revised example file w/ missing form (18.97 KB, application/octet-stream)
2017-05-14 17:09 UTC, Howard Johnson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Howard Johnson 2017-05-12 00:30:30 UTC
Created attachment 133252 [details]
Form with a Table control with a list box named Color ID.

In a Form with a Table Control holding a list-box, removal of a selection is clumsy.

In the attached db you can easily type only the first letter of the color to select that color.  That works great.

But you can not easily remove a color with only a single keystroke, such as a space.

Instead you have to physically remove your hand from the keyboard, grab the mouse, then click on the list-box, then possibly scroll up if you have a large list, then select the empty item at the very top of the list.  For someone who is doing lots of data entry this is a pain and I think can easily be improved.

How I hope this can work:

When I type a space in a list-box (as the first letter typed into the list-box) I would expect that an entry that either has a leading space or is blank is selected.  

I say either, because I fully expect that there might be some entries that legitimately begin with a space, and those should be honored first.  In that case if multiple spaces are entered until no records are selected, then the selected item should be the null item.  Here are some examples to make this more clear:


I. If your list looks like this (three items):

a
b
c

And you type space, anything (except a backspace), the list-box should be reset to null.


II. If your list looks like this:

space a
space b
c

And you type space, space, anything, the list-box should be reset to null.


III. If your list looks like this:

space
space a
b

And you type space, space, anything, the list-box should be reset to null.

If you type space, return, the first item which is "" should be selected.


III. If you type any letter, then backspace, the list-box should be returned to a state as if you had not typed anything.  In other words backspaces should undo any letters typed.


IV. For extra credit: I think hitting escape should undo any typing in that cell only.  As it is it undoes the entire record.  Hitting escape a 2nd time should undo the entire record.  

Hitting delete should probably clear the list box, and hitting delete a 2nd time should proceed to delete the record.


There are many more improvements that can also be done for list-boxes: support multiple columns with fixed or variable widths, allow copy, cut and paste, and add a few more useful events.  I'll try to suggest those later in another suggestion.

Thanks for looking at this.
Comment 1 Alex Thurgood 2017-05-12 07:09:31 UTC
From a personal perspective, I always took issue with databases that accepted beginning spaces as valid data entry input even when part of a further string..., let alone having blanks in lists in forms, so unfortunately, I will not be pushing for this...perhaps someone else in QA or the DB dev team might see a reasonable rationale for accepting this as a RFE.
Comment 2 Alex Thurgood 2017-05-12 07:12:41 UTC
@Howard: there doesn't appear to be any form in the file you attached to this report, just two tables.
Comment 3 Buovjaga 2017-05-12 17:59:14 UTC
Lionel: should we close this as WONTFIX?
Comment 4 Lionel Elie Mamane 2017-05-12 19:24:20 UTC
(In reply to Buovjaga from comment #3)
> Lionel: should we close this as WONTFIX?

Conflating space with null does not seem intuitive at all to me, but possibly that's a DBA / developer-centric view, or just my habit. I'd rather use the backspace or delete key, maybe the center key on the keypad (when not in numlock mode, because it has... nothing on it).

If the UX teams thinks it is a good idea, I will not veto it, and go back to the standard Free/Libre/Open Source answer: someone will have to implement it.
Comment 5 Buovjaga 2017-05-12 19:30:13 UTC
Invoking the power of the UX team.
Comment 6 Howard Johnson 2017-05-14 17:07:23 UTC
(In reply to Alex Thurgood from comment #2)
> @Howard: there doesn't appear to be any form in the file you attached to
> this report, just two tables.

Thanks for letting me know Alex.

I'll re-upload ListBoxIgnoresSpaces.odb.  

LO must have crashed right before my upload and then reverted to prior save, .. and the form got lost along the way.

:-(  Well, 'it happens.
Comment 7 Howard Johnson 2017-05-14 17:09:26 UTC
Created attachment 133314 [details]
Revised example file w/ missing form
Comment 8 Howard Johnson 2017-05-14 17:35:17 UTC
(In reply to Lionel Elie Mamane from comment #4)

>..I'd rather use the backspace or delete key, ..

Good I think:

Because Del in nullable Text and Numeric fields already returns the field to null, this is the same behavior as used elsewhere.  

I think Del key would be good in list-box to do this job!


...(Then perhaps later, the space method I presented above might make it even better, as the space bar is easier to hit than the delete key, and every keyboard has one ;-).  

Most of the time, data will not having a leading space, so you can quickly remove an item with just a single space.  (BTW, I didn't think of this myself.  Access does it this way too, and not to copy them, but just to try to speed data entry as much as possible for users, especially for things that are done all of the time with data entry.)



Not so good I think:

* Center key on keypad is probably out, as too many alternate keyboard issues already exist worldwide, e,g. mac vs pc, german, vs english, no-keypad at all...

* Backspace might work but if you've already typed some letters, then it needs to serve a dual purpose, erasing those typed selectors, one by one, until you back over the starting point, and then does this mean move field-left?  I think backspace is too confusing.  (BUT..., I do think backspace needs to undo typed selector key-strokes, e,g, if you type "del<backspace>" then the current list selector becomes just "de".)



Thanks guys.
Comment 9 Howard Johnson 2017-05-14 18:13:02 UTC
(In reply to Alex Thurgood from comment #1)
> ... databases that
> accepted beginning spaces as valid data entry input even when part of a
> further string...

Thanks Alex, and this makes no sense, and is not the way databases like MySQL, Posgres, Dbase, Access, etc., work.  So while there might be valid arguments for rejecting my improvement suggestion, this can't be one of them.

-------------------------------------------------------------------------

A data cell as just that, data.  It's not text, but just more generally data, to be used for whatever the database developer sees fit.  


Let me give you just one example:

Often I have a minor and major category.  For example, in a shopping list I have items to get, and each item has an associated category.

But this category is composed of a major and minor category.  To make this easy to type, I give my major categories a single letter, e.g. g = groceries, b = building materials, ...  then for the category lookup I can have 

g apples (grocery)
b 2x4s (building materials)

So with only a three keystrokes I can select an item, and it makes sense.  And I can also see what the g or b refer to, via the concatenated suffix in parens, e.g. (grocery).

Now as for leading spaces, sometimes it also make sense to have that major category missing but still selectable, like for miscellaneous items, for example, 

" plants (for the garden)".

Again with just two keystrokes, " p" I can select this item.

So keeping the ability to use leading spaces, is very much a part of modern databases.  If you want you can trim spaces when working with text, depending on what you're doing.


Of course there are many other reasons to allow leading spaces in data, like what if you suck in a whole bunch of text lines and then want to sort them to find the ones with leading spaces, or a certain number of leading spaces.
Comment 10 Alex Thurgood 2017-05-15 08:11:59 UTC
(In reply to Howard Johnson from comment #8)
> (In reply to Lionel Elie Mamane from comment #4)

> 
> Because Del in nullable Text and Numeric fields already returns the field to
> null, this is the same behavior as used elsewhere.  
> 
> I think Del key would be good in list-box to do this job!
> 


Please, if anyone does decide to implement this, remember that Mac keyboards do not have a DEL key !
Comment 11 Alex Thurgood 2017-05-15 08:13:04 UTC
Given Lionel's comments on the matter, let's set this to NEW and pass it on to UX.
Comment 12 Howard Johnson 2017-05-15 15:56:30 UTC
Good Q about the missing Mac Del key.

And this mac missing Del key issue is not new, and LO already deals with it.

All special keys on the mac need to be dealt with differently than for a pc.  

This is not a LO issue, it is a mac/pc issue.  

All programs that operate on both platforms have to remap key functionality between these platforms.

Some macs apparently do have a delete key usable with fn-delete.  http://osxdaily.com/2013/04/26/delete-key-mac-forward-del/ 

Others that don't have this key can use command-x (cut).  http://osxdaily.com/2013/04/26/delete-key-mac-forward-del/
Comment 13 Howard Johnson 2017-05-15 16:06:04 UTC
Also Ctrl-X (cut) in Base won't clear a list-box.  Del won't clear it.  Nothing on the keyboard will clear it.

(For that matter Ctrl-C and Ctrl-P (copy and paste) also doesn't work with a list-box, they should.  It is painful that they don't work to anyone trying to use Base.)


This is the one place that Base differs from Calc, Writer, etc. in the most simple editing tasks.


The bottom line is that a list-box needs a keyboard way of deleting the entry.

Thanks again.
Comment 14 Heiko Tietze 2018-06-27 08:49:53 UTC
(In reply to Lionel Elie Mamane from comment #4)
> I'd rather use the backspace or delete key...

That's what I expect too from the UX POV. Alternatively, right-clicking could provide a list of functions around this control including Delete rather than expanding the dropdown as today.

Adjusting the summary a bit.