[KULRICE-12549] Focus and jumping not working correctly Created: 21/Apr/14  Updated: 24/Sep/14  Resolved: 24/Jun/14

Status: Closed
Project: Kuali Rice Development
Component/s: Development
Affects Version/s: None
Fix Version/s: 2.5
Security Level: Public (Public: Anyone can view)

Type: Bug Fix Priority: Major
Reporter: Jerry Neal (Inactive) Assignee: Kristina Taylor (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 2 days
Original Estimate: 3 days

Similar issues:
KULRICE-8550Uif Components (Kitchen Sink) Jump to and Focus links not working
KULRICE-13467Fill AFT Gap: KRAD Library - Focus and Jump To
KULRICE-7890Links for errors do not jump correctly to the fields in question, but rather jitter and jump to the top of the page
KULRICE-7773Validation links no longer jump the user to the appropriate content
KULRICE-9697Focus LINE_FIRST is not working
KULRICE-11950Prevent resizing jump on lightbox
KULRICE-12578Weird jump behavior on Krad sample app when clicking an item
KULRICE-6563Add the standard "jump to main content" link
KULRICE-10057Page jumps to top then to first message when messages are returned from the server
KULRICE-10811Lookup Gap Analysis Focus Group
Rice Module:
KRAD Feature Area:
UIF Component
Sprint: Core 2.5.0-m3 Sprint 2, Core 2.5.0-m4 Sprint 1, Core 2.5.0-m4 Sprint 2
KAI Review Status: Not Required
KTI Review Status: Not Required
Code Review Status: Not Required
Include in Release Notes?:


Focus on and jump to is not working correctly now, in addition, there are some config improvements we need to make.

First if you set a focusId for an action component, focus is not set when a refresh occurs. I believe this is due to how the performFocusAndJumpTo method is being called from the page load event:

<@krad.script value="jQuery(document).on(kradVariables.PAGE_LOAD_EVENT, function(){


, true, true, '$




', '$


});" component=KualiForm.view.currentPage/>

Other problems include:

1) Setting focus id could override focus set when there are errors

I purpose we modify the implementation as follows:

For view and page refreshes, add the focusId and jumpTo as data attribute of the page. Note this can be done in PageGroup and should only be done if there is a value in the form property. Also if autoFocus is true, add a data attribute to the page.

For component refreshes, add focusId and jumpTo to the component wrapper div (look at uifRender.ftl).

Another thing I have noticed. When the default jumpTo is the action, the scroll puts the action at the top of the viewport. It would be better if we can position the action at the bottom of the viewport I think.

Create a new method for handling focus and jump. This should encapsulate all logic (of course can use helper methods), but should have logic for validation focusing and other cases. Invoke this method from document ready, page setup, and update component, passing in the data attributes (if found).

Create demos for this functionality in General Features. Should test the various focus setting and jump settings.

Comment by Jerry Neal (Inactive) [ 28/Apr/14 ]


Are you currently working on this? If so, we should touch base sometime.


Comment by Jerry Neal (Inactive) [ 28/Apr/14 ]

We also want to review the defaults we are setting. Including defaulting of jump to on actions. Most of the time, this gives undesired results. We can remove the default, and require them to set the jump id when needed. Let's review all the options for focus and jump, and our defaults as part of this.

Comment by Sona Sona (Inactive) [ 29/Apr/14 ]

I haven't yet started working on this jira. Hope to start looking into it later today. Let me know when you would like to talk more about it.

Comment by Sona Sona (Inactive) [ 08/May/14 ]


Link to the current analysis document

Comment by Sona Sona (Inactive) [ 03/Jun/14 ]

Hi Jerry,
I have made the changes for focus under various conditions and checked it in with examples in General Features. Now focusId and JumpTo are read as data attributes and we do not need to add the script in the ftls. I still have some questions on JumpTo

1. In the Jira https://jira.kuali.org/browse/KULRICE-12549
it mentions to focus the view port to the bottom when an action is clicked, while in the google doc you mention not to set jumpTo the action. What should I be doing?

2. In case of focus if none is specified, the default is the FIRST_INPUT. I am assuming for jumpTo the default will be TOP. If this is the case then for item 1 for every action click we will just jump to the top of the page.

3 In the jira it says, "Create a new method for handling focus and jump. This should encapsulate all logic (of course can use helper methods), but should have logic for validation focusing and other cases. Invoke this method from document ready, page setup, and update component, passing in the data attributes (if found)."

I am not sure I understand what this means? I am assuming this is talking about a function in JS and I already see a function perfomFocusAndJumpTo which gets invoked by document ready, page setup and update component with values from data attributes. What validations need to be performed besides checking if the component to focus is present? Are you talking about server messages. If so I have added logic so that the focus is on the first validation summary link. If not could you elaborate a little bit more.


Hi Sona,

Great! Would you mind to create a code review? Here are my responses to your questions (also copying Brian for his input):

1) Not set jumpTo anymore for the action

2) I believe the default focus for FIRST_INPUT should only be on initial view load. Did we state to set that as the default for all actions? I was thinking for actions the default was NEXT_INPUT, instead of collection line actions

3) I think this was just a general comment to consolidate the logic (the validation message focusing was one piece). Once I see the new code I might have some further suggestions for organizing.


Comment by Kristina Taylor (Inactive) [ 18/Jun/14 ]

Sona has created https://fisheye.kuali.org/cru/rice-425 for this.

Generated at Thu Jun 04 00:06:23 CDT 2020 using JIRA 6.1.5#6160-sha1:a61a0fc278117a0da0ec9b89167b8f29b6afdab2.