I’ve been a pediatrician for 20 years, and I thought I’d seen it all. But not long ago, when a father brought his 2-year-old into my clinic, something happened that has me deeply concerned.

Upon entering my examining room, I found father and son sitting together, eyes downcast, each silently scrolling and tapping on smartphones. During my initial exam, the father directed most of my questions to his frowning toddler, who indicated that his ears hurt, and I quickly discovered that both eardrums were red and inflamed.

“Guess what?” I said to my small patient. “Your ears hurt because you have an ear infection. But we can give you medicine and make you better.” I smiled at the little boy and his father. Immediately, the child picked up his phone and pushed a button. “Siri,” he asked carefully. “What ear ‘fection?”

At age 2, a few minutes on a smartphone isn’t a big deal; screen time is a part of growing up today, and most parents try to set appropriate limits. But when a child so young turned to a machine for information instead of to his father, it made me wonder: Just how limited was his parents’ screen time? What I saw was modeled behavior — a child who has learned that when he has a question, Siri, and not Dad, is most readily available with an answer.

It’s hard to say for sure based on this one moment, but there can be no doubt about the larger trend: Parents today are probably the most informed and involved generation in history. And, yet, in the company of their children, they often act as though they’d rather be someplace else. That’s what they’re saying when they break eye contact to glance at their push notifications or check Facebook when they think their child’s distracted. The parents are present, their attention is not.

In my practice, I see evidence every day of how such inattention affects kids. It’s expressed in temper tantrums and separation anxiety, and older children who resist discipline. Most parents are taught that this is all normal, that children are biologically wired this way. Not exactly. Yes, all of this is normal attention-getting behavior, but it often is preventable.

Consider the results of a March study by researchers from Boston Medical Center who carefully observed caregivers and children at fast-food restaurants. Out of 55 caregivers, 40 used their mobile devices, and their absorption was such that their “primary engagement was with the device, rather than the child.” In many cases, the caregivers expressed irritation when the children tried to get their attention. One observer watched a woman push a small boy away as he took her face in his hands in an attempt to get her to look up from her tablet.

It’s possible all those adults were following an urgent work e-mail thread. More likely, they were on Facebook, Twitter or Pinterest. A 2011 Nielsen poll found that people with children use social media more than those without. Maybe these adults were reading an article shared by another parent. Maybe they were making plans with friends and family. But they were definitely communicating to their children that they were less important than whatever was on those devices.

This might seem absurd to today’s parents, who feel like they give themselves to their children in ways previous generations never imagined. But the undivided attention that children need from us is in jeopardy. Most people just don’t realize how much time they’re spending online; what feels like a few minutes is often a half-hour or more. When we are with our children, we need to be with our children — not with them except for the part of us that’s reading e-mails, tweeting and checking Facebook.

Another reason for parents to put down their phones: Though Facebook may provide community, it can also promote competition and unreachable standards of perfection. Through Facebook, we read an endless litany of our friends’ boasts about their children. It’s enough to make a person wonder what she’s doing wrong because her child prefers plain pasta over the curry special or “Old MacDonald” to Chopin. Though most parents would say they’re not competitive in this way, many worry privately that they might be short-changing their kids.

Social media has a place and a purpose, but too many parents are creating unnecessary stress by trying to be in two places at once, while modeling to their children that online relationships take precedence over real ones. In an era of constant distraction, we must decide what’s more important: heeding the constant ping of our devices or telling our children, in word and deed, “I am listening. I am here. And there’s nowhere else I’d rather be.”