In this paper, we investigate the self-affirmation effect on formation of public opinion in a directed small-world social network. The system presents a non-equilibrium phase transition from a consensus state to a disordered state with coexistence of opinions. The dynamical behaviors are very sensitive to the density of long-range interactions and the strength of self-affirmation. When the long-range interactions are sparse and individual generally does not insist on his/her opinion, the system will display a continuous phase transition, in the opposite case with high self-affirmation strength and dense long-range interactions, the system does not display a phase transition. Between those two extreme cases, the system undergoes a discontinuous phase transition.