Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ pub mod web {
pub use webapi::events::focus::{
IFocusEvent,
FocusEvent,
FocusOutEvent,
BlurEvent
};

Expand Down
14 changes: 14 additions & 0 deletions src/webapi/events/focus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@ pub struct FocusEvent( Reference );
impl IEvent for FocusEvent {}
impl IFocusEvent for FocusEvent {}

/// The `FocusOutEvent` is fired when an element has been out of focus. The main
/// difference between this event and focusin is that only the latter bubbles.
///
/// [(JavaScript docs)](https://developer.mozilla.org/en-US/docs/Web/API/Element/focusout_event)
// https://w3c.github.io/uievents/#focusout
#[derive(Clone, Debug, PartialEq, Eq, ReferenceType)]
#[reference(instance_of = "FocusEvent")]
#[reference(event = "focusout")]
#[reference(subclass_of(Event, FocusRelatedEvent))]
pub struct FocusOutEvent( Reference );

impl IEvent for FocusOutEvent {}
impl IFocusEvent for FocusOutEvent {}

/// The `BlurEvent` is fired when an element has lost focus. The main difference
/// between this event and focusout is that only the latter bubbles.
///
Expand Down