Skip to main content

Search and Top Navigation

#15018 new feature ()

Opened July 25, 2016 04:27PM UTC

Last modified July 25, 2016 04:27PM UTC

Remove hash from datepicker anchor element and/or always call suppressDefault() in event handler

Reported by: DavidKDeutsch Owned by:
Priority: minor Milestone: none
Component: ui.datepicker Version: 1.12.0
Keywords: Cc:
Blocked by: Blocking:
Description

When code that responds to a change in the datepicker throws an exception, the browser performs the default action of navigating to the current URL plus the hash that is in the anchor tag that was clicked. This can result in undesired behavior in an angular application, which uses the hash for routing. Of course the fact that my code raises the exception in the first place is undesirable, and is the root cause, but it does make for confusing bug reports when my app navigates to a different view as the result of the exception. Would it be possible to remove the href attribute, and instead use CSS to control the cursor, or to call preventDefault() on the click event before calling _selectDay()?

A jsFiddle is at https://jsfiddle.net/rab050gu/. If you click "Show Href" before and after selecting a date in the calendar, you will see how the '#' is added to the end.

Attachments (0)
Change History (0)