Opened 10 years ago

Closed 10 years ago

#9619 closed defect (fixed)

InlineEditBox: save button not enabled when value changed via mouse

Reported by: jbarzilai Owned by: bill
Priority: low Milestone: 1.4
Component: Dijit Version: 1.3.2
Keywords: InlineEditBox, NumberSpinner, onChange Cc:
Blocked By: Blocking:

Description

See test_InlineEditBox.html. In "Form Letter with predefined values, and no auto-save" section after "for your purchase of":

Correct behavior:

  • Click on 3
  • Hit up or down arrow on keyboard
  • Save button is enabled (_onChange was called)

Incorrect behavior:

  • Click on 3
  • Click up or down arrow on the right side of the edit box
  • The save button is never enabled and _onChange is never called
  • If you hit enter it will call _onChange and enable the save button

Change History (6)

comment:1 Changed 10 years ago by jbarzilai

I just noticed that although the tooltip is the disabled tooltip and the button is greyed out that if you click the Save button it will still save. This is probably related because when you don't change the value and then click save nothing happens as it should.

comment:2 Changed 10 years ago by bill

Milestone: tbd1.4
Owner: set to bill
Status: newassigned
Summary: defect: InlineEditBox: Using arrows on NumberSpinner doesn't trigger _onChangeInlineEditBox: Using arrows on NumberSpinner doesn't trigger _onChange

OK, sounds like intermediateChanges=true should be added by default to the parameters passed to the editor (editorParams), or at least it should be added in the test file. Maybe default to true if the user hasn't explicitly set it to false, maybe:

dojo.delegate({intermediateChanges: true}, this.editorParams)

I'll check the save button thing too although I'm unclear what you are talking about regarding a tooltip.

comment:3 Changed 10 years ago by jbarzilai

Bill, I'm sorry I meant cursor not tooltip, my apologies. After changing the NumberSpinner? through the arrow buttons I moused over the Save button and the cursor changed to the disabled icon and the button was still greyed out. However, I clicked on it accidentally and it still worked.

I tried adding intermediateChanges:true to the editorParams in the example on the test file to no effect. Am I missing something? Thanks.

comment:4 Changed 10 years ago by bill

Actually I was missing something :-). I looked over the InlineEditBox code and for some reason, rather than relying on onChange events from the editor widget, it just monitors keystrokes (this is in the _onKeyPress() method)... so any time you press a key it checks if the save button should be activated. I guess we didn't anticipate widgets that are controlled by the mouse.

comment:5 Changed 10 years ago by bill

Summary: InlineEditBox: Using arrows on NumberSpinner doesn't trigger _onChangeInlineEditBox: save button not enabled when value changed via mouse

I talked to Doug about this.

The reason we aren't setting intermediateChanges=true and monitoring onChange() (to tell when the editor's value has changed and we should enable the save button) is that widgets like dijit.Editor don't have an intermediateChanges flag.

The bug extends beyond Spinner. It will happen for other widgets controlled by the mouse (like Slider), and even for Editor or a dijit.TextBox? when the user modifies the value by using the mouse -- by pasting into it via the browser right-click menu.

comment:6 Changed 10 years ago by bill

Resolution: fixed
Status: assignedclosed

In [19172]: InlineEditBox tries to enable/disable the save button depending on whether or not the user has changed the value. However, it was only working when the value was changed via keyboard, not when it was changed by mouse click our mouse-wheel move.

Simplify code to test whether the editor widget's value has changed by setting the editor widget's intermediateChanges=true and connecting to it's onChange() event. If the editor widget doesn't have an intermediateChanges parameter (such as dijit.Editor) then just enable the save button all the time.

Fixes #9619 !strict.

Note: See TracTickets for help on using tickets.