[Seaside] Anchor appearance when script attached

Johan Brichau johan at inceptive.be
Thu Mar 5 08:16:07 UTC 2015


Mind that that prevents default browser behavior.

You can prevent a link from getting keyboard focus by setting a negative tabIndex property: https://html.spec.whatwg.org/multipage/interaction.html#dom-tabindex <https://html.spec.whatwg.org/multipage/interaction.html#dom-tabindex>
The result is that it will never be able to respond to an enter using it’s click handler.

cheers
Johan

> On 05 Mar 2015, at 01:18, Laura Risani <laura.risani at gmail.com> wrote:
> 
> Didn't now you can shut down default behavior, interesting.
> 
> 
> On Wed, Mar 4, 2015 at 6:54 PM, Paul DeBruicker <pdebruic at gmail.com <mailto:pdebruic at gmail.com>> wrote:
> I'm not sure but you might could have also just used a 'return false;' at the
> end of your script to shut off the default behavior.
> 
> 
> 
> 
> 
> 
> 
> laura wrote
> > Seems that pressing keys space/enter also triggers onClick: . I changed
> > the
> > code to
> > button bePush onClick:aScript
> > and so onClick: is triggered just once whether for click/any keypress.
> >
> > Best,
> > Laura
> >
> > On Mon, Mar 2, 2015 at 8:37 PM, Laura Risani &lt;
> 
> > laura.risani@
> 
> > &gt; wrote:
> >
> >> I'm facing a problem with this code that we mentioned
> >> html anchor url:’javascript:{}’; onClick: aScript; onKeyDown:aScript
> >> the problem is that when pressing enter key (while the anchor has focus)
> >> triggers onKeyDown: (and variants) twice, while pressing any other key
> >> just does it (as desired) once.
> >> Is there a way to override this undesired behavior of enter key?
> >>
> >>
> >> On Mon, Mar 2, 2015 at 6:13 PM, Laura Risani &lt;
> 
> > laura.risani@
> 
> > &gt;
> >> wrote:
> >>
> >>> Hi Johan. I thought for a moment it would do something else...
> >>> I'll stick then with url:’javascript:{}’
> >>> Best,
> >>> Laura
> >>>
> >>> On Mon, Mar 2, 2015 at 4:43 PM, Johan Brichau &lt;
> 
> > johan@
> 
> > &gt; wrote:
> >>>
> >>>> Laura,
> >>>>
> >>>> That will make your page scroll to the top.
> >>>> Not always desirable…
> >>>>
> >>>> Johan
> >>>>
> >>>> On 02 Mar 2015, at 17:23, Laura Risani &lt;
> 
> > laura.risani@
> 
> > &gt; wrote:
> >>>>
> >>>> Seems that same anchor-like rendering by web browsers can be achieved
> >>>> with url:'#' (instead of url:’javascript:{}’ ).
> >>>>
> >>>> On Wed, Feb 18, 2015 at 4:17 PM, Johan Brichau &lt;
> 
> > johan@
> 
> > &gt;
> >>>> wrote:
> >>>>
> >>>>> Laura,
> >>>>>
> >>>>> > I had tried adding "callback:[]" but that renders the whole page
> >>>>> again.
> >>>>>
> >>>>> That’s to be expected.
> >>>>> I just wanted to make clear that if you do not add a callback, you
> >>>>> need
> >>>>> to set a url (href attribute) yourself or the browser will not show it
> >>>>> as a
> >>>>> (clickable) link.
> >>>>>
> >>>>> Johan_______________________________________________
> >>>>> seaside mailing list
> >>>>>
> 
> > seaside at .squeakfoundation
> 
> >>>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside <http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside>
> >>>>>
> >>>>
> >>>> _______________________________________________
> >>>> seaside mailing list
> >>>>
> 
> > seaside at .squeakfoundation
> 
> >>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside <http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside>
> >>>>
> >>>>
> >>>>
> >>>> _______________________________________________
> >>>> seaside mailing list
> >>>>
> 
> > seaside at .squeakfoundation
> 
> >>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside <http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside>
> >>>>
> >>>>
> >>>
> >>
> >
> > _______________________________________________
> > seaside mailing list
> 
> > seaside at .squeakfoundation
> 
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside <http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside>
> 
> 
> 
> 
> 
> --
> View this message in context: http://forum.world.st/Anchor-appearance-when-script-attached-tp4806275p4809599.html <http://forum.world.st/Anchor-appearance-when-script-attached-tp4806275p4809599.html>
> Sent from the Seaside General mailing list archive at Nabble.com.
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org <mailto:seaside at lists.squeakfoundation.org>
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside <http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside>
> 
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20150305/d37a37fc/attachment.htm


More information about the seaside mailing list